From ea13bba49a480ab372ce038e06ed88a829415e63 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Fri, 23 Oct 2020 17:05:02 +0300 Subject: [PATCH] Add generic_color::as_color_Xf --- libs/gfx/include/psemek/gfx/color.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libs/gfx/include/psemek/gfx/color.hpp b/libs/gfx/include/psemek/gfx/color.hpp index 8a9d8a4f..9110fab8 100644 --- a/libs/gfx/include/psemek/gfx/color.hpp +++ b/libs/gfx/include/psemek/gfx/color.hpp @@ -52,6 +52,16 @@ namespace psemek::gfx return to_coloru8(c); } + auto as_color_3f() const + { + return color_3f{c[0], c[1], c[2]}; + } + + auto as_color_4f() const + { + return c; + } + operator color_rgb() const { return as_color_rgb(); @@ -64,7 +74,7 @@ namespace psemek::gfx operator color_3f() const { - return color_3f{c[0], c[1], c[2]}; + return as_color_3f(); } operator color_4f() const