Get Panel Attributes - Colours
-
@Chazrox that is the color, as a decimal rather than hex.
-
@David-Healey How do I convert that to a HEX? and why did it produce that object when I pasted that decimal number in the chat?
-
@Chazrox It's possible that you didn't actually copy the decimal value and it pasted whatever else was on your clipboard.
If you use a clipboard manager, call it up and see what's actually in your clipboard history.
-
@Chazrox said in Get Panel Attributes - Colours:
How do I convert that to a HEX?
Engine.intToHexString()but you should be able to use the integer representation directly in your paint routines I think. -
@dannytaurus quite possible!
-
@David-Healey Yup that worked. Thanks!
Works.
var ColourNOW = 3758365736; Console.print(Engine.intToHexString(ColourNOW)); panelColourTesting.set("itemColour", ColourNOW); -
In the end, a number is a number. The format (base) is just a chosen representation of the same number, be it decimal, hexadecimal, binary, octal or whatever fancy base-factorial one can invent

-
@ustk great insight! Very true. I guess I could have just tried the decimal point first but I automatically thought it would be wrong. I just tried it and it does work both ways. Thanks!
-
C Chazrox marked this topic as a question
-
C Chazrox has marked this topic as solved
-
@ustk said in Get Panel Attributes - Colours:
In the end, a number is a number. The format (base) is just a chosen representation of the same number, be it decimal, hexadecimal, binary, octal or whatever fancy base-factorial one can invent

Except when you try an enter an integer in the property editor colour fields it misinterprets it.
-
@David-Healey There might be a bad parsing at some point. Without really knowing, the hex might be first parsed as string by the property editor...