alpha()

Color / Creating & Reading

Description

Extracts the alpha value from a color.

Syntax

float alpha(color c)

Parameters

NameTypeDescription
ccolorany color value

Returns

float

Related

Under the Hood

From Processing.h:

float alpha(color c);

Under the Hood

From Processing.cpp:

float PApplet::alpha(color c) { unsigned int v=c.value; return (v>>24&0xFF)/255.0f*colorMaxA; } float alpha=1.0f; alpha=std::stof(op);