Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
311 bytes
|
Line | |
---|
1 | module['exports'] = function(colors) {
|
---|
2 | // RoY G BiV
|
---|
3 | var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta'];
|
---|
4 | return function(letter, i, exploded) {
|
---|
5 | if (letter === ' ') {
|
---|
6 | return letter;
|
---|
7 | } else {
|
---|
8 | return colors[rainbowColors[i++ % rainbowColors.length]](letter);
|
---|
9 | }
|
---|
10 | };
|
---|
11 | };
|
---|
12 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.