File indexing completed on 2024-12-01 09:50:00

0001 /*  This file is part of the KDE project
0002     SPDX-FileCopyrightText: 2007 Matthew Woehlke <mw_triad@users.sourceforge.net>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 /*
0008  * If you use KColorSpaces in your own KDE code, please drop me a line at
0009  * mw_triad@users.sourceforge.net, as I would like to track if people find it
0010  * useful. Thanks!
0011  */
0012 
0013 #ifndef KCOLORSPACES_H
0014 #define KCOLORSPACES_H
0015 
0016 #include <QColor>
0017 
0018 namespace KColorSpaces
0019 {
0020 class KHCY
0021 {
0022 public:
0023     explicit KHCY(const QColor &);
0024     explicit KHCY(qreal h_, qreal c_, qreal y_, qreal a_ = 1.0);
0025     QColor qColor() const;
0026     qreal h, c, y, a;
0027     static qreal hue(const QColor &);
0028     static qreal chroma(const QColor &);
0029     static qreal luma(const QColor &);
0030 
0031 private:
0032     static qreal gamma(qreal);
0033     static qreal igamma(qreal);
0034     static qreal lumag(qreal, qreal, qreal);
0035 };
0036 
0037 }
0038 
0039 #endif