Browse Source

Make Color::withAlpha const

pull/321/merge
falkTX 3 years ago
parent
commit
c494e265cf
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      dgl/Color.hpp
  2. +1
    -1
      dgl/src/Color.cpp

+ 1
- 1
dgl/Color.hpp View File

@@ -68,7 +68,7 @@ struct Color {
/** /**
Create a new color based on this one but with a different alpha value. 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. Create a color specified by hue, saturation and lightness.


+ 1
- 1
dgl/src/Color.cpp View File

@@ -114,7 +114,7 @@ Color::Color(const Color& color1, const Color& color2, const float u) noexcept
interpolate(color2, u); interpolate(color2, u);
} }


Color Color::withAlpha(const float alpha2) noexcept
Color Color::withAlpha(const float alpha2) const noexcept
{ {
Color color(*this); Color color(*this);
color.alpha = alpha2; color.alpha = alpha2;


Loading…
Cancel
Save