55 constexpr explicit Opacity(uint32_t value)
61 "Opacity value has to be within the range of " + std::to_string(minimum) +
" to " + std::to_string(maximum) +
".");
72 PEAK_ICV_NO_DISCARD
constexpr uint32_t
GetValue()
const
84 PEAK_ICV_NO_DISCARD
static constexpr uint32_t
GetMinimum()
96 PEAK_ICV_NO_DISCARD
static constexpr uint32_t
GetMaximum()
109 std::enable_if_t<std::is_integral<Opacity>::value,
bool> =
true
114 return static_cast<uint32_t
>(value) == m_value;
124 static constexpr uint32_t minimum = 0;
125 static constexpr uint32_t maximum = 100;
126 uint32_t m_value{ maximum };
Thrown when a value is outside the allowed range.
Opacity refers to the transparency or the degree to which an object or pixel allows the background to...
constexpr Opacity(uint32_t value)
Constructs an Opacity object with the specified value.
constexpr uint32_t GetValue() const
Retrieve the current opacity value.
static constexpr uint32_t GetMaximum()
Get the largest possible value for opacity.
constexpr Opacity()
Constructs an Opacity object with a default value of 100.
auto operator==(const Opacity &value) const
static constexpr uint32_t GetMinimum()
Get the smallest possible value for opacity.