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");

console.log(red.diff(crimson)); // logs 17.118
console.log(red.diff(pink));    // logs 115.459
console.log(red.diff(white));   // logs 153.042
</script>
In this article
Not finding the help you need?