How can I specify the CHSV pallets? I try: DEFINE_GRADIENT_PALETTE( water_temperature_p ) { 0,

How can I specify the CHSV pallets? I try:

DEFINE_GRADIENT_PALETTE( water_temperature_p ) {
0, 0, 255, 255,
80, 207, 212, 214,
130, 89, 255, 255,
180, 44, 130, 145,
244, 140, 10, 174,
255, 0, 56, 174
};

CHSVPalette256 pallete = (CHSVPalette256) water_temperature_p;

And get the error:
“no matching function for call to ‘CHSVPalette256::CHSVPalette256(TProgmemRGBGradientPalette_byte [24])’”

Or is there any way to convert CRGB value from CRGBPallete256 to CHSV value? I’ve tried rgb2hsv_approximate(), but it gives some strange colors, that are not present in my pallete.

I don’t use CHSV palettes myself, but I DID squirrel away some info from Mark a while back, so try this:

// CHSV Palettes

Definitions:

CHSVPalette16 RainbowColorsHSV_p;
CHSVPalette16 currentPalette = RainbowColorsHSV_p;

Setup:

for( uint8_t j = 0; j < 16; j++) {
uint8_t hue = j * 16;
currentPalette[j] = CHSV( hue, 255, 255);
}

Loop:

CHSV color = ColorFromPalette(currentPalette, paletteIndex++);
fill_solid(leds, kNumLeds, color);

+Andrew Tulane Thanks. You really helped me! Also, I’ve found this way:

CHSVPalette256 water_temperature_p {
CHSV (170, 255, 255),
CHSV (139, 8, 211),
CHSV (43, 255, 255),
CHSV (0, 255, 255)
};

It takes 1, 2, 3, 4, 16 colors. But there is no way to set explicit position for every color. CRGB Palletes are more versatile. But I don’t know how to change hue of CRGB color returned from CRGB Pallete :frowning: