class ColorPicker def initialize(colored) @picker = colored ? NodeColors.new : DefaultColors.new end def color(index, ingress) @picker.color(index, ingress) end class NodeColors def color(index, ingress) ColorPicker::COLORS[index % ColorPicker::COLORS.length] end end class DefaultColors def color(index, ingress) ingress ? :blue : :red end end COLORS = %w( #00004c #000080 #0000fb #003a52 #0040cd #0050b2 #005390 #007800 #007eff #0096D8 #009917 #00B4AB #00a6a6 #00cafe #012456 #0298c3 #02f88c #04133b #0579aa #078193 #0aa0ff #0db7ed #0e60e3 #101F1F #118f9e #120F14 #14253c #178600 #185619 #198CE7 #199f4b #1C3552 #1D222D #1F1F1F #1ac620 #1e4aec #22228f #244776 #28431f #2ACCA8 #2F2530 #2b7489 #2c3e50 #302B6D #315665 #341708 #348a34 #3572A5 #358a5b #375eab #37775b #3A4E3A #3D6117 #3F3F3F #3F85AF #3ac486 #3be133 #3d3c6e #3d9970 #3fb68b #403a40 #40d47e #427819 #42f1f4 #438eff #447265 #44a51c #46390b #499886 #4A76B8 #4B6BEF #4B6C4B #4C3023 #4F5D95 #4d41b1 #5232e7 #555555 #563d7c #596706 #5A8164 #5B2063 #5a6986 #5c7611 #5e5086 #60B5CC #62A8D6 #636746 #646464 #64C800 #64b970 #652B81 #6594b9 #6600cc #665a4e #6866fb #6E4C13 #6a40fd #6c616e #6e4a7e #701516 #7055b5 #74283c #747faa #7582D1 #776791 #7790B2 #77d9fb #79aa7a #7b9db4 #7e7eff #7fa2a7 #800000 #814CCC #82937f #843179 #878787 #87AED7 #882B0F #88562A #88ccff #89e051 #8a1267 #8dc63f #8f0f8d #8f14e9 #8fb200 #913960 #945db7 #946d57 #94B0C7 #990000 #999999 #99DA07 #9DC3FF #9EEDFF #9d5200 #A0AA87 #AA6746 #B0CE4E #B34936 #B5314C #B83998 #B9D9FF #C1F12E #C76F5B #C7D7DC #DA5B0B #DAE1C2 #DBCA00 #E3F171 #E4E6F3 #E6EFBB #E8274B #EB8CEB #F18E33 #FEFE00 #FF5000 #FFF4F3 #a270ba #a3522f #a54c4d #a78649 #a9188d #a957b0 #aa2afe #adb2cb #b07219 #b0b77e #b2011d #b2b7f8 #b30000 #b7e1f4 #b845fc #ba595e #c065db #c22d40 #c4a79c #c7a938 #c9df40 #cabbff #cc0000 #cc0088 #cc9900 #cca760 #ccccff #ccce35 #cd6400 #cdd0e3 #cf142b #d4bec1 #d80074 #da291c #dad8d8 #db5855 #db901e #dbb284 #dc566d #dce200 #dea584 #df7900 #dfa535 #e16737 #e34c26 #e4cc98 #e69f56 #ecdebe #ed2cd6 #f0a9f0 #f1e05a #f34b7d #f3ca0a #f50000 #f7ede0 #f97732 #fab738 #fb855d #fbe5cd #fcd7de #ff0c5a #ff2b2b #ff6375 #ff7f7f #ffac45 #fffaa0 ) end