is there a way to allow the use of CHSV( , ,

is there a way to allow the use of CHSV( , , ) for progmem gradients?

this is what i’d like to do,:

const TProgmemHSVPalette16 fireHSV PROGMEM =
{
CHSV(0, 255, 0), //black
CHSV(0, 255, 51),
CHSV(0, 255, 102),
CHSV(0, 255, 153),
CHSV(0, 255, 204),
CHSV(0, 255, 255), //fades to red
CHSV(12, 255, 255),
CHSV(24, 255, 255),
CHSV(36, 255, 255),
CHSV(48, 255, 255),
CHSV(60, 255, 255), //fades to orange
CHSV(60, 204, 255),
CHSV(60, 153, 255),
CHSV(60, 102, 255),
CHSV(60, 51, 255),
CHSV(60, 0, 255) //fades to white
};

and I am getting this error message:
error: cannot convert ‘CHSV’ to ‘const uint32_t {aka const long unsigned int}’ in initialization

Compiles fine with CRGB( , , ,) but does very unexpected things with the colors.

Is it just that only CRGB constants (such as CRGB::Red) are work for progmem gradients?

What about a palette like this which gives you nice gradients between the specified colors:

currentPalette = CRGBPalette16(
CHSV( 0, 255, 0 ), //black
CHSV( 0, 255, 255), // red
CHSV( 64, 255, 255 ), // yellow
CHSV( 0, 0, 255)); // white

It compiles fine.

That’s my starting from place, but I’m specifically looking for palates stored in PGMEM as I’m going to be using this code on an attiny84 and i’ve only got 512 bytes of SRAM… I figured out though that I can just put in the HSV hex values and it works great :slight_smile:
const TProgmemHSVPalette16 fireHSV PROGMEM =
{
0xFF00,
0xFF33,
0xFF66,
0xFF99,
0xFFCC,
0xFFFF,
0xCFFFF,
0x18FFFF,
0x24FFFF,
0x30FFFF,
0x3CFFFF,
0x3CCCFF,
0x3C99FF,
0x3C66FF,
0x3C33FF,
0x3C00FF
};

It would be very handy not to have to compute the hex values first to do this though

worked like a charm, thanks!

I’ll see if I can put something like that in there. I’ve run into the same situation myself, and what I did was … much uglier :slight_smile: