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;