File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 5
5
const SALUTATION = 'Ave' ;
6
6
7
7
const COLORS = [
8
- /* 1 */ 'black' ,
9
- /* 2 */ 'red' ,
10
- /* 3 */ 'green' ,
11
- /* 4 */ 'yellow' ,
12
- /* 5 */ 'blue' ,
13
- /* 6 */ 'magenta' ,
14
- /* 7 */ 'cyan' ,
15
- /* 8 */ 'white'
8
+ /* 0 */ 'black' ,
9
+ /* 1 */ 'red' ,
10
+ /* 2 */ 'green' ,
11
+ /* 3 */ 'yellow' ,
12
+ /* 4 */ 'blue' ,
13
+ /* 5 */ 'magenta' ,
14
+ /* 6 */ 'cyan' ,
15
+ /* 7 */ 'white'
16
16
] ;
17
17
18
18
// Functions
@@ -22,10 +22,10 @@ const colorer = (s, color) => `\x1b[3${color}m${s}\x1b[0m`;
22
22
const colorize = name => {
23
23
let res = '' ;
24
24
const letters = name . split ( '' ) ;
25
- let color = 1 ;
25
+ let color = 0 ;
26
26
for ( const letter of letters ) {
27
27
res += colorer ( letter , color ++ ) ;
28
- if ( color > COLORS . length ) color = 1 ;
28
+ if ( color > COLORS . length ) color = 0 ;
29
29
}
30
30
return res ;
31
31
} ;
You can’t perform that action at this time.
0 commit comments