aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/GraphBase.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/platform/GraphBase.hpp')
-rw-r--r--include/cru/platform/GraphBase.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/cru/platform/GraphBase.hpp b/include/cru/platform/GraphBase.hpp
index b580ad31..6bf2736f 100644
--- a/include/cru/platform/GraphBase.hpp
+++ b/include/cru/platform/GraphBase.hpp
@@ -316,6 +316,12 @@ struct Color {
(hex >> 24) & mask);
}
+ constexpr Color WithAlpha(std::uint8_t new_alpha) const {
+ auto result = *this;
+ result.alpha = new_alpha;
+ return result;
+ }
+
std::uint8_t red;
std::uint8_t green;
std::uint8_t blue;