Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 38e0536c authored by Boudewijn Rempt's avatar Boudewijn Rempt

Add operator< to KoColor so we can use colors as keys in QMap

parent 5ab41992
......@@ -134,6 +134,15 @@ KoColor & KoColor::operator=(const KoColor & rhs)
return * this;
bool KoColor::operator<(const KoColor &other) const
QColor c = toQColor();
int gray = qGray(,,;
QColor c2 = other.toQColor();
return gray > qGray(,,;
bool KoColor::operator==(const KoColor &other) const
if (!(*colorSpace() == *other.colorSpace()))
......@@ -67,6 +67,11 @@ public:
KoColor &operator=(const KoColor &other);
* @brief operator < compares the current color the other color and return true if this color is darker
bool operator<(const KoColor &other) const;
bool operator==(const KoColor &other) const;
/// return the current colorSpace
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment