Populating setValueForMode with dynamic values

I’m experimenting with a plugin that creates color shades variable sets. I’m stuck on dynamically creating the shades.

let’s say I have this:

const baseColor = { r: 77, g: 77, b: 77 };
colorVariableDefault.setValueForMode(valuesColId, baseColor);
colorVariableDark25.setValueForMode(valuesColId, darkenColor(baseColor, 25));

setValueForMode is not allowing me to use the baseColor variable value, instead it ONLY accepts { r: 0, g: 0, b: 0 } to be written inside it.

any help would be appreciated.

Actually my bad, solved … the RGB values to be used are 0 to 1 and not 0 to 255.

You can also use the utilities:

1 Like