summaryrefslogtreecommitdiff
path: root/src/color.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-07-26 00:26:43 +0200
committerMaxime Coste <frrrwww@gmail.com>2013-07-26 00:54:58 +0200
commitd5453152b3f025169a27fb05fd1f6a9d839301b2 (patch)
tree53ca3e2b380b92f8228f766647a43cc4595bca5b /src/color.hh
parent8f73d3c173b8cb3c5ff027996ea6779c2c7a7ed5 (diff)
Color,ColorPair: always pass by copy
Diffstat (limited to 'src/color.hh')
-rw-r--r--src/color.hh9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/color.hh b/src/color.hh
index 9cc5abf5..16e6b678 100644
--- a/src/color.hh
+++ b/src/color.hh
@@ -34,21 +34,20 @@ struct Color
Color(unsigned char r, unsigned char g, unsigned char b)
: color{Colors::RGB}, r{r}, g{g}, b{b} {}
- bool operator==(const Color& c) const
+ bool operator==(Color c) const
{ return color == c.color and r == c.r and g == c.g and b == c.b; }
- bool operator!=(const Color& c) const
+ bool operator!=(Color c) const
{ return color != c.color or r != c.r or g != c.g or b != c.b; }
};
using ColorPair = std::pair<Color, Color>;
Color str_to_color(const String& color);
-String color_to_str(const Color& color);
+String color_to_str(Color color);
-String option_to_string(const Color& color);
+String option_to_string(Color color);
void option_from_string(const String& str, Color& color);
}
#endif // color_hh_INCLUDED
-