58 constexpr explicit Opacity(uint32_t value)
64 "Opacity value has to be within the range of " + std::to_string(minimum) +
" to " + std::to_string(maximum) +
".");
73 PEAK_COMMON_NO_DISCARD
constexpr uint32_t
GetValue()
const
83 PEAK_COMMON_NO_DISCARD
static constexpr uint32_t
GetMinimum()
93 PEAK_COMMON_NO_DISCARD
static constexpr uint32_t
GetMaximum()
106 std::enable_if_t<std::is_integral<Opacity>::value,
bool> =
true
111 return static_cast<uint32_t
>(value) == m_value;
121 static constexpr uint32_t minimum = 0;
122 static constexpr uint32_t maximum = 100;
123 uint32_t m_value{ maximum };
Holds an opacity value representing the transparency level of an object or pixel.
constexpr Opacity(uint32_t value)
Constructs an Opacity object with the specified value.
constexpr uint32_t GetValue() const
static constexpr uint32_t GetMaximum()
constexpr Opacity()
Constructs an Opacity object with full opacity (100).
auto operator==(const Opacity &value) const
static constexpr uint32_t GetMinimum()
Thrown when a value is outside the allowed range.