-
RGB to HEX value #ffaadd to Text Source Layer Expression/Extendscript
Hi, I am trying to write an expression that will spit out #HEX value to a text layer source. The RGBA color will come from a fill color on a solid layer.
I cannot find anything to convert RGB to a HEX value only rgb to hsl.
Is this even possible through expression or extendscript?
This is what I have so far, which will spit out RGBA values from converting rgbtohsl and then back to hsltorgb*255
Any help is appreciated. Please feel free to email me, jc****@********rk.com.
Joe
in_rgb = thisComp.layer("controller").effect("color_04")("Color");
in_hsl = rgbToHsl(in_rgb);
new_hue = (in_hsl[0] + 0) % 1;
new_sat = in_hsl[1] * ((thisComp.layer("color_04_tint").effect("saturation")("Slider")/100)+1);
new_lightness = in_hsl[2] * ((thisComp.layer("color_04_tint").effect("brightness")("Slider")/100)+1);
mod_hsl = [new_hue, new_sat, new_lightness, in_hsl[3]];src = hslToRgb(mod_hsl) * 255;