Skip to content
Reference > Methods

clrGetLum(color)

Definition

Double clrGetLum(String color)

Description

Returns an Integer between 0-255 that is the luminance of the supplied color. Returns null if supplied color is null or invalid format.

Parameter Definition

Name Type Description
color String Color to inspect in rrggbb format

Examples

1
2
3
4
5
6
7
Double r1 = clrGetLum("#FF0000"); // r1 == 49.999237048905165
Double r2 = clrGetLum("#FFFF00"); // r2 == 49.999237048905165
Double r3 = clrGetLum("#FFFFFF"); // r3 == 100.0
Double r4 = clrGetLum("#ABC"); // r4 == 73.33333333333333
Double r5 = clrGetLum("#ABCD"); // r5 == 73.33333333333333
Object r6 = clrGetLum("invalid"); // r6 == null
Object r7 = clrGetLum(null); // r7 == null