In javaScript (within Photoshop) when giving a hex colour a value it's in quotes eg "FCAA00"
var hexCol = "FCAA00";
var fgColor = new SolidColor;
fgColor.rgb.hexValue = hexCol
but when passing a variable to that value you don't need the quotes. Why is this?
var hexCol = convertRgbToHex(252, 170, 0)
hexCol = "\"" + hexCol + "\""; // These quotes are not needed.
var fgColor = new SolidColor;
fgColor.rgb.hexValue = hexCol
Is this just a javaScript quirk or am I missing something going on behind the scenes, as it were. Thank you.
convertRGBToHex()
returns a string, then that is the equivalent ofvar hexCol = "FCAA00";