toBytes

Returns the color in "Bytes" representation. It has the same properties as RGB, but r, g and b are integers between 0 and 255 instead of floats.

This does not modify the current object, it creates a new one instead.

Returns

Object An object with r, g and b fields.

Example

<script>
var color = kendo.parseColor("#ff0000");
var bytesColor = color.toBytes();
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(bytesColor); // logs {r: 255, g: 0, b: 0, a: 1}
</script>
In this article
toBytes
Not finding the help you need?
Contact Support