Just stumbled upon this again over the weekend (I'd seen it before once, but never used it). It's the Randomizer service in Adafruit IO, which offers random words, colours, numbers, or entries from a list. See more here (if you're signed in), and you access the values via MQTT or the HTTP API (instructions on the page).
Anyway, while fantasising about data (specifically how long could my list of values be in randomizer), my mind got caught in rainbow colour sequences, and here we are...
I wanted to insert a long list of items, and thought that's the perfect use for ChatGPT, monotonous lists. It's especially good at understanding simple instructions, although I usually find I need to refine my initial request/prompt.
" generate me a rainbow sequence of colours, hash prefixed and comma separated. the sequence should effectively loop if repeated."
It failed to intuit (I never said), that I wanted a long sequence, and instead offered me the 7 colours of the rainbow in a list.
Realising my error, of implicit assumed knowledge, I added an extra phrase to clarify my desire:
"generate me a rainbow sequence of colours, hash prefixed and comma separated. the sequence should effectively loop if repeated. Give me a 100 value transition through the colour spectrum
And there we have it, a nice colour sequence, which I then increased to 256 items. Communication is key, and not easy, or at least it is easy to make grave assumptions and inadvertently mess-up.
100 Items:
#ff0000, #ff0f00, #ff1e00, #ff2d00, #ff3d00, #ff4c00, #ff5b00, #ff6b00, #ff7a00, #ff8900, #ff9900, #ffa800, #ffb700, #ffc600, #ffd600, #ffe500, #fff400, #f9ff00, #eaff00, #dbff00, #cbff00, #bcff00, #adff00, #9eff00, #8eff00, #7fff00, #70ff00, #60ff00, #51ff00, #42ff00, #33ff00, #23ff00, #14ff00, #05ff00, #00ff0a, #00ff19, #00ff28, #00ff38, #00ff47, #00ff56, #00ff66, #00ff75, #00ff84, #00ff93, #00ffa3, #00ffb2, #00ffc1, #00ffd1, #00ffe0, #00ffef, #00ffff, #00efff, #00e0ff, #00d1ff, #00c1ff, #00b2ff, #00a3ff, #0093ff, #0084ff, #0075ff, #0066ff, #0056ff, #0047ff, #0038ff, #0028ff, #0019ff, #000aff, #0500ff, #1400ff, #2300ff, #3200ff, #4200ff, #5100ff, #6000ff, #7000ff, #7f00ff, #8e00ff, #9e00ff, #ad00ff, #bc00ff, #cc00ff, #db00ff, #ea00ff, #f900ff, #ff00f4, #ff00e5, #ff00d6, #ff00c6, #ff00b7, #ff00a8, #ff0098, #ff0089, #ff007a, #ff006b, #ff005b, #ff004c, #ff003d, #ff002d, #ff001e, #ff000f
256 items:
#ff0000, #ff0500, #ff0b00, #ff1100, #ff1700, #ff1d00, #ff2300, #ff2900, #ff2f00, #ff3500, #ff3b00, #ff4100, #ff4700, #ff4d00, #ff5300, #ff5900, #ff5f00, #ff6500, #ff6b00, #ff7100, #ff7700, #ff7d00, #ff8300, #ff8900, #ff8f00, #ff9500, #ff9b00, #ffa100, #ffa700, #ffad00, #ffb300, #ffb900, #ffbf00, #ffc500, #ffcb00, #ffd100, #ffd700, #ffdd00, #ffe300, #ffe900, #ffef00, #fff500, #fffb00, #fdff00, #f7ff00, #f1ff00, #ebff00, #e5ff00, #dfff00, #d9ff00, #d3ff00, #cdff00, #c7ff00, #c1ff00, #bbff00, #b5ff00, #afff00, #a9ff00, #a3ff00, #9dff00, #97ff00, #91ff00, #8bff00, #85ff00, #7fff00, #79ff00, #73ff00, #6dff00, #67ff00, #61ff00, #5bff00, #55ff00, #4fff00, #49ff00, #43ff00, #3dff00, #37ff00, #31ff00, #2bff00, #25ff00, #1fff00, #19ff00, #13ff00, #0dff00, #07ff00, #01ff00, #00ff03, #00ff09, #00ff0f, #00ff15, #00ff1b, #00ff21, #00ff27, #00ff2d, #00ff33, #00ff39, #00ff3f, #00ff45, #00ff4b, #00ff51, #00ff57, #00ff5d, #00ff63, #00ff69, #00ff6f, #00ff75, #00ff7b, #00ff81, #00ff87, #00ff8d, #00ff93, #00ff99, #00ff9f, #00ffa5, #00ffab, #00ffb1, #00ffb7, #00ffbd, #00ffc3, #00ffc9, #00ffcf, #00ffd5, #00ffdb, #00ffe1, #00ffe7, #00ffed, #00fff3, #00fff9, #00ffff, #00f9ff, #00f3ff, #00edff, #00e7ff, #00e1ff, #00dbff, #00d5ff, #00cfff, #00c9ff, #00c3ff, #00bdff, #00b7ff, #00b1ff, #00abff, #00a5ff, #009fff, #0099ff, #0093ff, #008dff, #0087ff, #0081ff, #007bff, #0075ff, #006fff, #0069ff, #0063ff, #005dff, #0057ff, #0051ff, #004bff, #0045ff, #003fff, #0039ff, #0033ff, #002dff, #0027ff, #0021ff, #001bff, #0015ff, #000fff, #0009ff, #0003ff, #0100ff, #0700ff, #0d00ff, #1300ff, #1900ff, #1f00ff, #2500ff, #2b00ff, #3100ff, #3700ff, #3d00ff, #4300ff, #4900ff, #4f00ff, #5500ff, #5b00ff, #6100ff, #6700ff, #6d00ff, #7300ff, #7900ff, #7f00ff, #8500ff, #8b00ff, #9100ff, #9700ff, #9d00ff, #a300ff, #a900ff, #af00ff, #b500ff, #bb00ff, #c100ff, #c700ff, #cd00ff, #d300ff, #d900ff, #df00ff, #e500ff, #eb00ff, #f100ff, #f700ff, #fd00ff, #ff00fb, #ff00f5, #ff00ef, #ff00e9, #ff00e3, #ff00dd, #ff00d7, #ff00d1, #ff00cb, #ff00c5, #ff00bf, #ff00b9, #ff00b3, #ff00ad, #ff00a7, #ff00a1, #ff009b, #ff0095, #ff008f, #ff0089, #ff0083, #ff007d, #ff0077, #ff0071, #ff006b, #ff0065, #ff005f, #ff0059, #ff0053, #ff004d, #ff0047, #ff0041, #ff003b, #ff0035, #ff002f, #ff0029, #ff0023, #ff001d, #ff0017, #ff0011, #ff000b, #ff0005
And long story short, Adafruit IO Randomizer service happily let me setup a list with 256 values, and generated a random one.
It's worth noting they change every minute, and remain in sync with any matching the same seed value.
Extension Project - Questionably useful things
The last thing to add is that ChatGPT fails in many places/ways, but it's always interesting to test, so I went further and tried to get it to colour-correct the values in the list, based on the human perception of some colours being better than others, along with the issue of RGB lights having different strengths in each colour, then while writing this I also remembered I'd not clarified the rgb issue enough as the individual coloured LEDs are fine at higher brightness's.
What I found most interesting was after the last clarification (but the second query mentioning RGBW LEDs) it offered me colour hex values including a fourth white component, which is actually what I'd originally questioned if I'd wanted all along...
For posterity I've included it all in collapsible sections, so I suggest you collapse them all and use the last one, but read them by all means! My questions/prompts are in bold (title of collapsible), and ChatGPT is the collapsible content:
I've adjusted the sequences to account for human sensitivity to different colors and the varying brightness of RGB LEDs in RGBW configurations. The adjustments are based on typical sensitivity curves and LED brightness levels, emphasizing the need for slight reductions in the intensity of the red, green, and blue components to align with human visual sensitivity and LED output characteristics.
Here's the adjusted sequence for 100 transitions:
#e50000, #e50a00, #e51500, #e51f00, #e52a00, #e53500, #e53f00, #e54a00, #e55500, #e55f00, #e56b00, #e57500, #e58000, #e58a00, #e59500, #e5a000, #e5aa00, #e0b200, #d2b200, #c5b200, #b6b200, #a9b200, #9bb200, #8eb200, #7fb200, #72b200, #64b200, #56b200, #48b200, #3bb200, #2db200, #1fb200, #12b200, #04b200, #00b205, #00b20c, #00b214, #00b21c, #00b223, #00b22b, #00b233, #00b23a, #00b242, #00b249, #00b251, #00b259, #00b260, #00b268, #00b270, #00b277, #00b27f, #00a77f, #009c7f, #00927f, #00877f, #007c7f, #00727f, #00667f, #005c7f, #00517f, #00477f, #003c7f, #00317f, #00277f, #001c7f, #00117f, #00077f, #04007f, #12007f, #1f007f, #2d007f, #3b007f, #48007f, #56007f, #64007f, #72007f, #7f007f, #8e007f, #9b007f, #a9007f, #b7007f, #c5007f, #d2007f, #e0007f, #e5007a, #e50072, #e5006b, #e50063, #e5005b, #e50054, #e5004c, #e50044, #e5003d, #e50035, #e5002d, #e50026, #e5001e, #e50016, #e5000f, #e50007
And for 256 transitions:
#e50000, #e50300, #e50700, #e50b00, #e51000, #e51400, #e51800, #e51c00, #e52000, #e52500, #e52900, #e52d00, #e53100, #e53500, #e53a00, #e53e00, #e54200, #e54600, #e54a00, #e54f00, #e55300, #e55700, #e55b00, #e55f00, #e56400, #e56800, #e56c00, #e57000, #e57400, #e57900, #e57d00, #e58100, #e58500, #e58900, #e58e00, #e59200, #e59600, #e59a00, #e59e00, #e5a300, #e5a700, #e5ab00, #e5af00, #e3b200, #deb200, #d8b200, #d3b200, #ceb200, #c8b200, #c3b200, #bdb200, #b8b200, #b3b200, #adb200, #a8b200, #a2b200, #9db200, #98b200, #92b200, #8db200, #87b200, #82b200, #7db200, #77b200, #72b200, #6cb200, #67b200, #62b200, #5cb200, #57b200, #51b200, #4cb200, #47b200, #41b200, #3cb200, #36b200, #31b200, #2cb200, #26b200, #21b200, #1bb200, #16b200, #11b200, #0bb200, #06b200, #00b200, #00b201, #00b204, #00b207, #00b20a, #00b20d, #00b210, #00b213, #00b216, #00b219, #00b21c, #00b21f, #00b222, #00b225, #00b228, #00b22b, #00b22e, #00b231, #00b234, #00b237, #00b23a, #00b23d, #00b240, #00b243, #00b246, #00b249, #00b24c, #00b24f, #00b252, #00b255, #00b258, #00b25b, #00b25e, #00b261, #00b264, #00b267, #00b26a, #00b26d, #00b270, #00b273, #00b276, #00b279, #00b27c, #00b27f, #00ae7f, #00aa7f, #00a57f, #00a17f, #009d7f, #00997f, #00957f, #00907f, #008c7f, #00887f, #00847f, #00807f, #007b7f, #00777f, #00737f, #006f7f, #006b7f, #00667f, #00627f, #005e7f, #005a7f, #00567f, #00517f, #004d7f, #00497f, #00457f, #00417f, #003c7f, #00387f, #00347f, #00307f, #002c7f, #00277f, #00237f, #001f7f, #001b7f, #00177f, #00127f, #000e7f, #000a7f, #00067f, #00027f, #00007f, #06007f, #0b007f, #11007f, #16007f, #1b007f, #21007f, #26007f, #2c007f, #31007f, #36007f, #3c007f, #41007f, #47007f, #4c007f, #51007f, #57007f, #5c007f, #62007f, #67007f, #6c007f, #72007f, #77007f, #7d007f, #82007f, #87007f, #8d007f, #92007f, #98007f, #9d007f, #a2007f, #a8007f, #ad007f, #b3007f, #b8007f, #bd007f, #c3007f, #c8007f, #ce007f, #d3007f, #d8007f, #de007f, #e3007f, #e5007d, #e5007a, #e50077, #e50074, #e50071, #e5006e, #e5006b, #e50068, #e50065, #e50062, #e5005f, #e5005c, #e50059, #e50056, #e50053, #e50050, #e5004d, #e5004a, #e50047, #e50044, #e50041, #e5003e, #e5003b, #e50038, #e50035, #e50032, #e5002f, #e5002c, #e50029, #e50026, #e50023, #e50020, #e5001d, #e5001a, #e50017, #e50014, #e50011, #e5000e, #e5000b, #e50008, #e50005, #e50002
These adjusted sequences should provide a more visually balanced experience, taking into account the inherent differences in perceived brightness among the red, green, and blue components as well as the sensitivity of the human eye.
I've adjusted the sequences to better suit the characteristics of RGBW LEDs, considering their performance at different brightness levels and the variance in brightness at lower levels of PWM for each color. This adjustment aims to maintain a consistent perceived brightness across the spectrum by leveraging the white LED component more effectively, especially at lower brightness levels where color LEDs may vary significantly in output.
Here's the adjusted sequence for 100 transitions, including the white component in the hex values:
#ff000000, #ff0f0000, #ff1e0000, #ff2d0000, #ff3d0000, #ff4c0000, #ff5b0000, #ff6b0000, #ff7a0000, #ff890000, #ff990000, #ffa80000, #ffb70000, #ffc60000, #ffd60000, #ffe50000, #fff40000, #f9ff0000, #eaff0000, #dbff0000, #cbff0000, #bcff0000, #adff0000, #9eff0000, #8eff0000, #7fff0000, #70ff0000, #60ff0000, #51ff0000, #42ff0000, #33ff0000, #23ff0000, #14ff0000, #05ff0000, #00ff0a00, #00ff1900, #00ff2800, #00ff3800, #00ff4700, #00ff5600, #00ff6600, #00ff7500, #00ff8400, #00ff9300, #00ffa300, #00ffb200, #00ffc100, #00ffd100, #00ffe000, #00ffef00, #00ffff00, #00efff00, #00e0ff00, #00d1ff00, #00c1ff00, #00b2ff00, #00a3ff00, #0093ff00, #0084ff00, #0075ff00, #0066ff00, #0056ff00, #0047ff00, #0038ff00, #0028ff00, #0019ff00, #000aff00, #0500ff00, #1400ff00, #2300ff00, #3200ff00, #4200ff00, #5100ff00, #6000ff00, #7000ff00, #7f00ff00, #8e00ff00, #9e00ff00, #ad00ff00, #bc00ff00, #cc00ff00, #db00ff00, #ea00ff00, #f900ff00, #ff00f400, #ff00e500, #ff00d600, #ff00c600, #ff00b700, #ff00a800, #ff009800, #ff008900, #ff007a00, #ff006b00, #ff005b00, #ff004c00, #ff003d00, #ff002d00, #ff001e00, #ff000f00
And for 256 transitions, incorporating the white component as well:
#ff000000, #ff050000, #ff0b0000, #ff110000, #ff170000, #ff1d0000, #ff230000, #ff290000, #ff2f0000, #ff350000, #ff3b0000, #ff410000, #ff470000, #ff4d0000, #ff530000, #ff590000, #ff5f0000, #ff650000, #ff6b0000, #ff710000, #ff770000, #ff7d0000, #ff830000, #ff890000, #ff8f0000, #ff950000, #ff9b0000, #ffa10000, #ffa70000, #ffad0000, #ffb30000, #ffb90000, #ffbf0000, #ffc50000, #ffcb0000, #ffd10000, #ffd70000, #ffdd0000, #ffe30000, #ffe90000, #ffef0000, #fff50000, #fffb0000, #fdff0000, #f7ff0000, #f1ff0000, #ebff0000, #e5ff0000, #dfff0000, #d9ff0000, #d3ff0000, #cdff0000, #c7ff0000, #c1ff0000, #bbff0000, #b5ff0000, #afff0000, #a9ff0000, #a3ff0000, #9dff0000, #97ff0000, #91ff0000, #8bff0000, #85ff0000, #7fff0000, #79ff0000, #73ff0000, #6dff0000, #67ff0000, #61ff0000, #5bff0000, #55ff0000, #4fff0000, #49ff0000, #43ff0000, #3dff0000, #37ff0000, #31ff0000, #2bff0000, #25ff0000, #1fff0000, #19ff0000, #13ff0000, #0dff0000, #07ff0000, #01ff0000, #00ff0300, #00ff0900, #00ff0f00, #00ff1500, #00ff1b00, #00ff2100, #00ff2700, #00ff2d00, #00ff3300, #00ff3900, #00ff3f00, #00ff4500, #00ff4b00, #00ff5100, #00ff5700, #00ff5d00, #00ff6300, #00ff6900, #00ff6f00, #00ff7500, #00ff7b00, #00ff8100, #00ff8700, #00ff8d00, #00ff9300, #00ff9900, #00ff9f00, #00ffa500, #00ffab00, #00ffb100, #00ffb700, #00ffbd00, #00ffc300, #00ffc900, #00ffcf00, #00ffd500, #00ffdb00, #00ffe100, #00ffe700, #00ffed00, #00fff300, #00fff900, #00ffff00, #00f9ff00, #00f3ff00, #00edff00, #00e7ff00, #00e1ff00, #00dbff00, #00d5ff00, #00cfff00, #00c9ff00, #00c3ff00, #00bdff00, #00b7ff00, #00b1ff00, #00abff00, #00a5ff00, #009fff00, #0099ff00, #0093ff00, #008dff00, #0087ff00, #0081ff00, #007bff00, #0075ff00, #006fff00, #0069ff00, #0063ff00, #005dff00, #0057ff00, #0051ff00, #004bff00, #0045ff00, #003fff00, #0039ff00, #0033ff00, #002dff00, #0027ff00, #0021ff00, #001bff00, #0015ff00, #000fff00, #0009ff00, #0003ff00, #0100ff00, #0700ff00, #0d00ff00, #1300ff00, #1900ff00, #1f00ff00, #2500ff00, #2b00ff00, #3100ff00, #3700ff00, #3d00ff00, #4300ff00, #4900ff00, #4f00ff00, #5500ff00, #5b00ff00, #6100ff00, #6700ff00, #6d00ff00, #7300ff00, #7900ff00, #7f00ff00, #8500ff00, #8b00ff00, #9100ff00, #9700ff00, #9d00ff00, #a300ff00, #a900ff00, #af00ff00, #b500ff00, #bb00ff00, #c100ff00, #c700ff00, #cd00ff00, #d300ff00, #d900ff00, #df00ff00, #e500ff00, #eb00ff00, #f100ff00, #f700ff00, #fd00ff00, #ff00fb00, #ff00f500, #ff00ef00, #ff00e900, #ff00e300, #ff00dd00, #ff00d700, #ff00d100, #ff00cb00, #ff00c500, #ff00bf00, #ff00b900, #ff00b300, #ff00ad00, #ff00a700, #ff00a100, #ff009b00, #ff009500, #ff008f00, #ff008900, #ff008300, #ff007d00, #ff007700, #ff007100, #ff006b00, #ff006500, #ff005f00, #ff005900, #ff005300, #ff004d00, #ff004700, #ff004100, #ff003b00, #ff003500, #ff002f00, #ff002900, #ff002300, #ff001d00, #ff001700, #ff001100, #ff000b00, #ff000500
These sequences include a white component to each color value, reflecting adjustments made to accommodate the characteristics of RGBW LEDs. This approach aims to leverage the strengths of RGBW LEDs for more uniform brightness and color quality throughout the spectrum.