ZenitUI
Retained-mode C++20 UI framework
Loading...
Searching...
No Matches
ZenitUI::Color Struct Reference

8-bit-per-channel RGBA color, non-premultiplied. More...

#include <CoreTypes.hpp>

Public Member Functions

Color withAlpha (float k) const
 Return a copy with the alpha channel scaled by k.
bool operator== (const Color &o) const
bool operator!= (const Color &o) const

Public Attributes

uint8_t r {255}
uint8_t g {255}
uint8_t b {255}
uint8_t a {255}

Detailed Description

8-bit-per-channel RGBA color, non-premultiplied.

Examples
00_demo/main.cpp, 11_animations/main.cpp, 12_effects_canvas/main.cpp, and 16_data_table/main.cpp.

Member Function Documentation

◆ withAlpha()

Color ZenitUI::Color::withAlpha ( float k) const
inline

Return a copy with the alpha channel scaled by k.

Parameters
kMultiplier in [0, 1], clamped. Multiplies the existing alpha.
Examples
12_effects_canvas/main.cpp.

The documentation for this struct was generated from the following file: