Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const options = {
- [Rainbow.Red]: () => new RGBColor(0xFF, 0x00, 0x00),
- [Rainbow.Orange]: () => new RGBColor(0xFF, 0x7F, 0x00),
- [Rainbow.Yellow]: () => new RGBColor(0xFF, 0xFF, 0x00),
- [Rainbow.Green]: () => new RGBColor(0x00, 0xFF, 0x00),
- [Rainbow.Blue]: () => new RGBColor(0x00, 0x00, 0xFF),
- [Rainbow.Indigo]: () => new RGBColor(0x4B, 0x00, 0x82),
- [Rainbow.Violet]: () => new RGBColor(0x94, 0x00, 0xD3),
- default: colorBand => throw Error(`invalid enum value ${colorBand}`),
- };
- (options[colorBand] || options.default)(colorBand)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement