-
Convert color from hsl to hex after applied expression and then return the value to the source text
Hello, I’m not so proficient in programming expressions so I’m hoping that you guys could help me with upgrading some code that I found here. I have a shape with a fill. Inside this fill is an expression that brightens the color from another shape.
c = comp("Color Theming").layer("Secondary 2").content("Secondary").content("Fill 1").colorhsl = rgbToHsl(c);
factor = 1.3; // 30% brighten
newL = Math.min(hsl[2]*factor,1);
hslToRgb([hsl[0],hsl[1],newL,hsl[3]])
At the end of this expression I would like to convert hsl to hex and then pass that value to the source text that will be in Color Theming composition. I couldn’t find that specific function that converts hsl to hex. I assume that adding that part of expression to the fill and then linking source text to that fill color will do the job. Am I correct?

