toHex

converts a decimal number to the hexadecimal format

string toHex(number number, [number length] );

Parameters

numbernumberthe decimal number
lengthnumberthe length of the hexadecimal number

Returns

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