toHex

converts a decimal number to the hexadecimal format

string toHex(number number, [number length] );
numbernumberthe decimal number
lengthnumberthe length of the hexadecimal number
stringthe hexadecimal number

Example

webix.color.toHex(123456);// -> "1E240"
 
webix.color.toHex(123456, 10);// -> "000001E240"

Details

Note that the length parameter is used to add leading zeros to the number.

See also
Back to top
Join Our Forum
We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.