summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/color.cpp34
-rw-r--r--src/gui/color.h11
2 files changed, 9 insertions, 36 deletions
diff --git a/src/gui/color.cpp b/src/gui/color.cpp
index aa9ffe840..2536e2947 100644
--- a/src/gui/color.cpp
+++ b/src/gui/color.cpp
@@ -78,9 +78,9 @@ Color::Color() :
}
Color::Color(const unsigned int color) :
- r((color >> 16) & 0xFF),
- g((color >> 8) & 0xFF),
- b(color & 0xFF),
+ r((color >> 16) & 0xFFU),
+ g((color >> 8) & 0xFFU),
+ b(color & 0xFFU),
a(255U)
{
}
@@ -113,9 +113,9 @@ Color Color::operator+(const Color& color) const
Color Color::operator-(const Color& color) const
{
Color result(r - color.r,
- g - color.g,
- b - color.b,
- 255U);
+ g - color.g,
+ b - color.b,
+ 255U);
result.r = (result.r > 255U ? 255U : result.r);
result.g = (result.g > 255U ? 255U : result.g);
@@ -127,9 +127,9 @@ Color Color::operator-(const Color& color) const
Color Color::operator*(const float value) const
{
Color result(static_cast<int>(static_cast<float>(r) * value),
- static_cast<int>(static_cast<float>(g) * value),
- static_cast<int>(static_cast<float>(b) * value),
- a);
+ static_cast<int>(static_cast<float>(g) * value),
+ static_cast<int>(static_cast<float>(b) * value),
+ a);
result.r = (result.r > 255U ? 255U : result.r);
result.g = (result.g > 255U ? 255U : result.g);
@@ -147,19 +147,3 @@ bool Color::operator!=(const Color& color) const
{
return !(r == color.r && g == color.g && b == color.b && a == color.a);
}
-
-std::ostream& operator<<(std::ostream& out,
- const Color& color)
-{
- out << "Color [r = "
- << color.r
- << ", g = "
- << color.g
- << ", b = "
- << color.b
- << ", a = "
- << color.a
- << "]";
-
- return out;
-}
diff --git a/src/gui/color.h b/src/gui/color.h
index db8fda970..bfa66b796 100644
--- a/src/gui/color.h
+++ b/src/gui/color.h
@@ -64,8 +64,6 @@
#ifndef GUI_COLOR_H
#define GUI_COLOR_H
-#include <iostream>
-
#include "localconsts.h"
/**
@@ -160,15 +158,6 @@ class Color final
bool operator!=(const Color& color) const;
/**
- * Output operator for output.
- *
- * @param out The stream to output to.
- * @param color The color to output.
- */
- friend std::ostream& operator<<(std::ostream& out,
- const Color& Color);
-
- /**
* Holds the red color component (range 0-255).
*/
unsigned int r;