color
Get or set the selected color. If no argument is given, this returns the currently selected color as a kendo.Color
object.
Parameters
color kendo.Color
(optional)
The color that should be set as the current value
Returns
kendo.Color
the current value
Example
<div id="colorpicker"></div>
<script>
$("#colorpicker").kendoColorPicker();
var colorpicker = $("#colorpicker").data("kendoColorPicker");
// set picker color
colorpicker.color(kendo.parseColor("#ff0000"));
// get picker color
var currentColor = colorpicker.color();
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(currentColor.toHex()); // logs the color in hex format
</script>
In this article