|
NovaSVG 0.10.0
A header-only SVG library
|
Lightweight helper class for color blending operations. More...
#include <color.h>

Public Member Functions | |
| ColorBlend (const Color &base, int percent) | |
| Construct a ColorBlend from a base color and percentage. | |
| Color | operator| (const Color &other) const |
| Finalize the blend with a specific color. | |
| ColorBlend | operator| (const ColorBlend &other) const |
| Chain multiple blend operations. | |
| operator Color () const | |
| Implicit conversion to Color. | |
Public Attributes | |
| Color | baseColor |
| The base color being blended. | |
| int | percentage |
| Percentage for the blend operation (0-100) | |
Lightweight helper class for color blending operations.
This class holds the intermediate state of a color blend operation and allows chaining multiple blends in a fluent manner.
|
inline |
Construct a ColorBlend from a base color and percentage.
| base | The base color to blend. |
| percent | The percentage of the blend (0-100). |
|
inline |
Implicit conversion to Color.
Finalizes the blend with transparent (default behavior).
Definition at line 909 of file color.h.
References baseColor, novasvg::Color::blend(), percentage, and novasvg::Color::transparent().
Finalize the blend with a specific color.
Blends the base color with the specified color using the stored percentage.
| other | The color to blend with. |
Definition at line 883 of file color.h.
References baseColor, novasvg::Color::blend(), and percentage.
|
inline |
Chain multiple blend operations.
Allows chaining like: "gray"_c | 50 | "black"_c
| other | The ColorBlend to chain with. |
Definition at line 895 of file color.h.
References baseColor, novasvg::Color::blend(), percentage, and novasvg::Color::transparent().
| Color novasvg::ColorBlend::baseColor |
The base color being blended.
Definition at line 857 of file color.h.
Referenced by operator Color(), operator|(), and operator|().
| int novasvg::ColorBlend::percentage |
Percentage for the blend operation (0-100)
Definition at line 858 of file color.h.
Referenced by operator Color(), operator|(), and operator|().