fromRGB

Creates a new color object from the rgba channels in the 0..1 range.

Parameters

red Number

The red channel of the color, in the range from 0 to 1.

green Number

The green channel of the color, in the range from 0 to 1.

blue Number

The blue channel of the color, in the range from 0 to 1.

alpha Number (optional)

The alpha channel of the color, in the range from 0 to 1. Defaults to 1 when omitted.

Returns

kendo.Color A new object that represents the color with the passed color coordinates

Example - get the level of the node

<script>
var color = kendo.Color.fromRGB(1,0,0);
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(color.toCss()); // logs "#ff0000"

color = kendo.Color.fromRGB(0,1,0,1);
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(color.toCssRgba()); // logs "rgba(0, 255, 0, 1)"
</script>
In this article
fromRGB
Not finding the help you need?
Contact Support