From c494e265cf7dafb2ebf8109c3c337157049bab97 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 17 Aug 2022 10:25:56 +0100 Subject: [PATCH] Make Color::withAlpha const --- dgl/Color.hpp | 2 +- dgl/src/Color.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dgl/Color.hpp b/dgl/Color.hpp index fbce9cc2..51534734 100644 --- a/dgl/Color.hpp +++ b/dgl/Color.hpp @@ -68,7 +68,7 @@ struct Color { /** Create a new color based on this one but with a different alpha value. */ - Color withAlpha(float alpha) noexcept; + Color withAlpha(float alpha) const noexcept; /** Create a color specified by hue, saturation and lightness. diff --git a/dgl/src/Color.cpp b/dgl/src/Color.cpp index 10382fbd..454ada38 100644 --- a/dgl/src/Color.cpp +++ b/dgl/src/Color.cpp @@ -114,7 +114,7 @@ Color::Color(const Color& color1, const Color& color2, const float u) noexcept interpolate(color2, u); } -Color Color::withAlpha(const float alpha2) noexcept +Color Color::withAlpha(const float alpha2) const noexcept { Color color(*this); color.alpha = alpha2;