diff options
author | Mark Kriegsman <kriegsman@tr.org> | 2014-03-14 07:39:37 +0400 |
---|---|---|
committer | Mark Kriegsman <kriegsman@tr.org> | 2014-03-14 07:39:37 +0400 |
commit | 8f6253d138ebe2051759c142aa746289b5e1a5b7 (patch) | |
tree | 597313ae70a4fc0edd3ec0365e5cd1c4e41997bc | |
parent | 04933bc0b272e7fe7e8b33f7d7e66aa0c70d5f0f (diff) |
Change to 'twothirds' to a slightly (one bit) more accurate value.
-rw-r--r-- | hsv2rgb.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/hsv2rgb.cpp b/hsv2rgb.cpp index b0abdab9..43379a0e 100644 --- a/hsv2rgb.cpp +++ b/hsv2rgb.cpp @@ -337,7 +337,8 @@ void hsv2rgb_rainbow( const CHSV& hsv, CRGB& rgb) } if( Y2 ) { r = K171 + third; - uint8_t twothirds = (third << 1); + //uint8_t twothirds = (third << 1); + uint8_t twothirds = scale8( offset8, ((256 * 2) / 3)); g = K85 + twothirds; b = 0; FORCE_REFERENCE(b); @@ -350,7 +351,8 @@ void hsv2rgb_rainbow( const CHSV& hsv, CRGB& rgb) // 010 //case 2: // Y -> G if( Y1 ) { - uint8_t twothirds = (third << 1); + //uint8_t twothirds = (third << 1); + uint8_t twothirds = scale8( offset8, ((256 * 2) / 3)); r = K171 - twothirds; g = K171 + third; b = 0; @@ -381,7 +383,8 @@ void hsv2rgb_rainbow( const CHSV& hsv, CRGB& rgb) //case 4: // A -> B r = 0; FORCE_REFERENCE(r); - uint8_t twothirds = (third << 1); + //uint8_t twothirds = (third << 1); + uint8_t twothirds = scale8( offset8, ((256 * 2) / 3)); g = K171 - twothirds; b = K85 + twothirds; |