red()

Color / Creating & Reading

Description

Extracts the red value from a color.

Syntax

float red(color c)

Parameters

NameTypeDescription
ccolorany color value

Returns

float

Related

Under the Hood

From Processing.h:

float red(color c);

Under the Hood

From Processing.cpp:

float PApplet::red(color c) { unsigned int v=c.value; return (v>>16&0xFF)/255.0f*colorMaxH; }