SkColor4f members may be read and written directly without using a member function.
Each component is stored as a 32-bit single precision floating point float value. All values are allowed, but only the range from zero to one is meaningful.
Each component is independent of the others; fA Alpha is not Premultiplied with fG green, fB blue, or fR red.
Values smaller than zero or larger than one are allowed. Values out of range may be used with Blend Mode so that the final component is in range.
SkColor4f operators inline class member functions with arithmetic equivalents.
SkColor4f member functions read and modify the structure properties.
Compares Color4f with other, and returns true if all components are equivalent.
true if Color4f equals other
colorRed == colorNamedRed
operator!=(const SkColor4f& other) const
Compares Color4f with other, and returns true if all components are not equivalent.
true if Color4f is not equal to other
colorGray != colorNamedGray
operator==(const SkColor4f& other) const
Returns Color4f components as a read-only array.
components as read-only array
red=0.266667 green=0.533333 blue=0.8 alpha=0.533333 [0]=0.266667 [1]=0.533333 [2]=0.8 [3]=0.533333
SkColor4f
Returns Color4f components as a writable array.
components as writable array
red=0.266667 green=0.533333 blue=0.8 alpha=0.533333 [0]=0.266667 [1]=0.533333 [2]=0.8 [3]=1
SkColor4f
Constructs and returns Color4f with each component pinned from zero to one.
Color4f with valid components
pin FromColor
Converts to closest Color4f.
Color4f equivalent
red=0.301961 green=0.396078 blue=0.6 alpha=0.168627 red=77 green=101 blue=153 alpha=43
toSkColor
Converts to closest SkColor.
closest Color
red=18 green=33 blue=82 alpha=43 red=0.0705882 green=0.129412 blue=0.321569 alpha=0.168627
FromColor
Returns Color4f with all components in the range from zero to one.
Color4f with valid components
Pin
Returns SkColor4f with all components premultiplied by Alpha.
Premultiplied color
unpremul
Returns SkColor4f with all components independent of Alpha.
Unpremultiplied color
premul
premultiplied color