summaryrefslogtreecommitdiffstats
path: root/src/gui/rgba.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/rgba.hpp')
-rw-r--r--src/gui/rgba.hpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gui/rgba.hpp b/src/gui/rgba.hpp
index 0d2c57aa..e01a069d 100644
--- a/src/gui/rgba.hpp
+++ b/src/gui/rgba.hpp
@@ -20,8 +20,7 @@
#include <cmath>
#include <cstdint>
-namespace ingen {
-namespace gui {
+namespace ingen::gui {
inline uint32_t
rgba_to_uint(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
@@ -35,7 +34,7 @@ rgba_to_uint(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
inline uint8_t
mono_interpolate(uint8_t v1, uint8_t v2, float f)
{
- return static_cast<uint8_t>(rintf((v2) * (f) + (v1) * (1 - (f))));
+ return static_cast<uint8_t>(rintf((v2 * f) + (v1 * (1.0f - f))));
}
#define RGBA_R(x) (static_cast<uint32_t>(x) >> 24)
@@ -53,7 +52,6 @@ rgba_interpolate(uint32_t c1, uint32_t c2, float f)
mono_interpolate(RGBA_A(c1), RGBA_A(c2), f));
}
-} // namespace gui
-} // namespace ingen
+} // namespace ingen::gui
#endif // INGEN_GUI_RGBA_HPP