|
tiny-skia-cpp
A C++20 2D rendering library (port of tiny-skia)
|
Floating-point RGBA color [0,1] (straight alpha).
#include <tiny_skia/Color.h>

Public Member Functions | |
| void | applyOpacity (float opacity) |
| Multiplies alpha by opacity (clamped to [0,1]). | |
| PremultipliedColor | premultiply () const |
| Converts to premultiplied alpha. | |
| ColorU8 | toColorU8 () const |
| Converts to 8-bit color. | |
Static Public Member Functions | |
| static Color | fromRgbaUnchecked (float red, float green, float blue, float alpha) |
| Creates without validation (values must be in [0,1]). | |
| static std::optional< Color > | fromRgba (float red, float green, float blue, float alpha) |
| Creates with validation. Returns nullopt if any component is outside [0,1]. | |
| static Color | fromRgba8 (AlphaU8 red, AlphaU8 green, AlphaU8 blue, AlphaU8 alpha) |
| Creates from 8-bit components. | |