Skip to content
Reference > Methods

clrGetRed(color)

Definition

Integer clrGetRed(String color)

Description

Returns an Integer between 0-255 that is the red component 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
Integer r1 = clrGetRed("#AABBCC"); // r1 == 170
Integer r2 = clrGetRed("#AABBCCDD"); // r2 == 170
Integer r3 = clrGetRed("#ABC"); // r3 == 170
Integer r4 = clrGetRed("#ABCD"); // r4 == 170
Object r5 = clrGetRed("invalid"); // r5 == null
Object r6 = clrGetRed(null); // r6 == null