lots more color work, closer and closer to being ready for ... being taken apart again

This commit is contained in:
Paul Davis 2014-12-08 15:52:18 -05:00
parent e1c6f3bf6c
commit 624a86c39d
8 changed files with 136 additions and 116 deletions

View file

@ -17,6 +17,7 @@
*/
#include <algorithm>
#include <sstream>
#include <cmath>
#include <stdint.h>
#include <cfloat>
@ -236,6 +237,26 @@ HSV::HSV (Color c)
color_to_hsva (c, h, s, v, a);
}
HSV::HSV (const std::string& str)
{
stringstream ss (str);
ss >> h;
ss >> s;
ss >> v;
ss >> a;
}
string
HSV::to_string () const
{
stringstream ss;
ss << h << ' ';
ss << s << ' ';
ss << v << ' ';
ss << a;
return ss.str();
}
bool
HSV::is_gray () const
{