|
| | Color (void) |
| | Default constructor creating opaque black.
|
| |
| | Color (Type red, Type green, Type blue) |
| | Construct color with RGB values (fully opaque).
|
| |
| | Color (Type red, Type green, Type blue, Type alpha) |
| | Construct color with RGBA values.
|
| |
| | Color (const Color &other) |
| | Copy constructor.
|
| |
| | Color (Color &&other) noexcept |
| | Move constructor.
|
| |
| Color & | operator= (const Color &other) |
| | Copy assignment operator.
|
| |
| Color & | operator= (Color &&other) noexcept |
| | Move assignment operator.
|
| |
| void | setRed (Type red) |
| | Set the red component.
|
| |
| Type | getRed (void) const |
| | Get the red component.
|
| |
| void | setGreen (Type green) |
| | Set the green component.
|
| |
| Type | getGreen (void) const |
| | Get the green component.
|
| |
| void | setBlue (Type blue) |
| | Set the blue component.
|
| |
| Type | getBlue (void) const |
| | Get the blue component.
|
| |
| void | setAlpha (Type alpha) |
| | Set the alpha (opacity) component.
|
| |
| Type | getAlpha (void) const |
| | Get the alpha (opacity) component.
|
| |
| void | setRGBA (Type red, Type green, Type blue, Type alpha) |
| | Set all RGBA components.
|
| |
| bool | operator== (const Color &other) const |
| | Equality comparison.
|
| |
| bool | operator!= (const Color &other) const |
| | Inequality comparison.
|
| |
| Color | operator+ (const Color &other) const |
| | Component-wise color addition (clamped).
|
| |
| Color | operator- (const Color &other) const |
| | Component-wise color subtraction (clamped).
|
| |
| Color | operator* (Type scalar) const |
| | Scalar multiplication of color components.
|
| |
| Color | grayscale (void) const |
| | Convert color to grayscale using luminance formula.
|
| |
| Color | inverted (void) const |
| | Invert the color (keeping alpha unchanged).
|
| |
| Color | lerp (const Color &other, Type t) const |
| | Linearly interpolate between this color and another.
|
| |
| Color | blendOver (const Color &background) const |
| | Alpha blend this color over another background color.
|
| |
| Color | lighter (Type factor) const |
| | Create a lighter version of this color.
|
| |
| Color | darker (Type factor) const |
| | Create a darker version of this color.
|
| |
| Color | withAlpha (Type alpha) const |
| | Return a copy with a different alpha value.
|
| |
| bool | isOpaque (void) const |
| | Check whether alpha is fully opaque.
|
| |
| bool | isTransparent (void) const |
| | Check whether alpha is fully transparent.
|
| |
| double | alpha01 (void) const |
| | Get alpha normalized to [0, 1].
|
| |
| bool | operator< (const Color &other) const |
| | Less-than operator for Color.
|
| |
template<CanBeColorComponent Type>
class utility::graphic::Color< Type >
RGBA color with arithmetic type components.
- Template Parameters
-
| Type | Arithmetic type for color components (typically float or uint8_t) |
Components are expected to be normalized: [0.0, 1.0] for floating-point types or [0, 255] for integral types.
Definition at line 60 of file color.hpp.