Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const options = {
  2.     [Rainbow.Red]: () => new RGBColor(0xFF, 0x00, 0x00),
  3.     [Rainbow.Orange]: () => new RGBColor(0xFF, 0x7F, 0x00),
  4.     [Rainbow.Yellow]: () => new RGBColor(0xFF, 0xFF, 0x00),
  5.     [Rainbow.Green]: () => new RGBColor(0x00, 0xFF, 0x00),
  6.     [Rainbow.Blue]: () => new RGBColor(0x00, 0x00, 0xFF),
  7.     [Rainbow.Indigo]: () => new RGBColor(0x4B, 0x00, 0x82),
  8.     [Rainbow.Violet]: () => new RGBColor(0x94, 0x00, 0xD3),
  9.     default: colorBand => throw Error(`invalid enum value ${colorBand}`),
  10. };
  11. (options[colorBand] || options.default)(colorBand)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement