diff

Computes the relative luminance between two colors.

Returns

Number The relative luminance.

Example

<script>
var red = kendo.parseColor("#ff0000");

var crimson = kendo.parseColor("#dc143c");
var pink = kendo.parseColor("#ffc0cb");
var white = kendo.parseColor("#ffffff");

/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(red.diff(crimson)); // logs 17.118
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(red.diff(pink));    // logs 115.459
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(red.diff(white));   // logs 153.042
</script>
In this article