Skip to main content
Inspiring
August 6, 2012
Answered

Hexadecimal Input

  • August 6, 2012
  • 1 reply
  • 653 views

Hey Guys,

I did some looking around but I can't seem to find anything about INPUT of a hex code via script.  ScriptListener also outputs code referencing RGB even when editing the hex field of the color picker.  About the most I was able to find was something referencing the RGBColor.hexValue property, but not how to use it.  The template files I'm being given all come with their colors in hex, so I need a way to input those into the code to change the color.  Thanks for any help!

dgolberg

This topic has been closed for replies.
Correct answer Ghoulfool

You can use colour in Hex, CMYK or RGB. But if you're using hex you still have to add a rgb property to it .Try this:

// set foreground colour to red

var fgColor = new SolidColor;

fgColor.rgb.hexValue ="ff0000"  //bright red

foregroundColor = fgColor

1 reply

GhoulfoolCorrect answer
Inspiring
August 6, 2012

You can use colour in Hex, CMYK or RGB. But if you're using hex you still have to add a rgb property to it .Try this:

// set foreground colour to red

var fgColor = new SolidColor;

fgColor.rgb.hexValue ="ff0000"  //bright red

foregroundColor = fgColor

dgolbergAuthor
Inspiring
August 6, 2012

Awesome!  That was exactly what I was looking for.  Thanks a ton!