Number.prototype.toColorPart Returns the hexadecimal string representation of the number.
num.toColorPart();
The hexadecimal representation of num.
<script type="text/javascript">
var red = 255;
var green = 0;
var blue = 0;
var saturatedRedColor = '#' + red.toColorPart() + green.toColorPart() + blue.toColorPart();
$('myLabel').style.color = saturatedRedColor;
</script>
saturatedRedColor is equal to ’#ff0000’.
If the number is lower than 16, it will be prefixed by a leading zero.