Esempio n. 1
0
void fill_rainbow( struct CRGB * pFirstLED, int numToFill,
                  uint8_t initialhue,
                  uint8_t deltahue )
{
    CHSV hsv;
    hsv.hue = initialhue;
    hsv.val = 255;
    hsv.sat = 255;
    for( int i = 0; i < numToFill; i++) {
        hsv2rgb_rainbow( hsv, pFirstLED[i]);
        hsv.hue += deltahue;
    }
}
void RNGradient::getColor(int32_t position, uint8_t &red, uint8_t &green, uint8_t &blue) {
    uint8_t v1, v2, v3;
    getValue(position, v1, v2, v3);
    if (isHSV) {
        CHSV hsv;
        CRGB rgb;
        hsv.h = v1;
        hsv.s = v2;
        hsv.v = v3;
        hsv2rgb_rainbow(hsv,rgb);
        red = rgb.r;
        green = rgb.g;
        blue = rgb.b;
    } else {
        red = v1;
        green = v2;
        blue = v3;
    }
}