Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkriegsman@gmail.com <kriegsman@gmail.com@4ad4ec5c-605d-bd5c-5796-512c9b60011b>2013-04-27 23:45:20 +0400
committerkriegsman@gmail.com <kriegsman@gmail.com@4ad4ec5c-605d-bd5c-5796-512c9b60011b>2013-04-27 23:45:20 +0400
commitf1cbc2661b894089b00c0c3fc72442809da59d59 (patch)
treea4c869e38fbf36a262af9e75edb50c020c68af00 /hsv2rgb.cpp
parentbee973ce104298d8025b1824fb6534ed998472c3 (diff)
MEK: Add references and links re: color spaces and color conversions.
Diffstat (limited to 'hsv2rgb.cpp')
-rw-r--r--hsv2rgb.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/hsv2rgb.cpp b/hsv2rgb.cpp
index 45cf326b..3d5c3d62 100644
--- a/hsv2rgb.cpp
+++ b/hsv2rgb.cpp
@@ -364,5 +364,43 @@ void rainbow2rgb( const CHSV& hsv, CRGB& rgb)
}
+// References:
+// Spectra and rainbows are not the same thing. Wikipedia has a good
+// illustration here
+// http://upload.wikimedia.org/wikipedia/commons/f/f6/Prism_compare_rainbow_01.png
+// from this article
+// http://en.wikipedia.org/wiki/Rainbow#Number_of_colours_in_spectrum_or_rainbow
+// that shows a 'spectrum' and a 'rainbow' side by side. Among other
+// differences, you'll see that a 'rainbow' has much more yellow than
+// a plain spectrum. "Classic" LED color washes are spectrum based, and
+// usually show very little yellow.
+//
+// Wikipedia's page on HSV color space, with pseudocode for conversion
+// to RGB color space
+// http://en.wikipedia.org/wiki/HSL_and_HSV
+// Note that their conversion algorithm, which is (naturally) very popular
+// is in the "maximum brightness at any given hue" style, vs the "uniform
+// brightness for all hues" style.
+//
+// You can't have both; either purple is the same brightness as red, e.g
+// red = #FF0000 and purple = #800080 -> same "total light" output
+// OR purple is 'as bright as it can be', e.g.
+// red = #FF0000 and purple = #FF00FF -> purple is much brighter than red.
+// The colorspace conversions here try to keep the apparent brightness
+// constant even as the hue varies.
+//
+// Adafruit's "Wheel" function, discussed here
+// http://forums.adafruit.com/viewtopic.php?f=47&t=22483
+// is also of the "constant apparent brightness" variety.
+//
+// TODO: provide the 'maximum brightness no matter what' variation.
+//
+// See also some good, clear Arduino C code from Kasper Kamperman
+// http://www.kasperkamperman.com/blog/arduino/arduino-programming-hsb-to-rgb/
+// which in turn was was based on Windows C code from "nico80"
+// http://www.codeproject.com/Articles/9207/An-HSB-RGBA-colour-picker
+
+
+
#endif