File indexing completed on 2024-05-12 04:58:27
0001 /* 0002 * Bespin library for Qt style, KWin decoration and everything else 0003 * Copyright 2007-2012 by Thomas Lübking <thomas.luebking@gmail.com> 0004 * 0005 * This library is free software; you can redistribute it and/or modify 0006 * it under the terms of the GNU Library General Public License version 2 0007 * 0008 * This program is distributed in the hope that it will be useful, 0009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0011 * GNU Library General Public License for more details 0012 * 0013 * You should have received a copy of the GNU Library General Public 0014 * License along with this program; if not, write to the 0015 * Free Software Foundation, Inc., 0016 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0017 */ 0018 0019 #ifndef COLORS_H 0020 #define COLORS_H 0021 0022 class QWidget; 0023 #include <QColor> 0024 #include <QPalette> 0025 0026 // namespace Bespin { 0027 namespace Colors 0028 { 0029 0030 const QColor &bg(const QPalette &pal, const QWidget* w); 0031 int contrast(const QColor &a, const QColor &b); 0032 QPalette::ColorRole counterRole(QPalette::ColorRole role); 0033 bool counterRole(QPalette::ColorRole &from, QPalette::ColorRole &to, 0034 QPalette::ColorRole defFrom = QPalette::WindowText, 0035 QPalette::ColorRole defTo = QPalette::Window); 0036 QColor emphasize(const QColor &c, int value = 10); 0037 bool haveContrast(const QColor &a, const QColor &b); 0038 QColor light(const QColor &c, int value); 0039 QColor mid(const QColor &oc1, const QColor &c2, int w1 = 1, int w2 = 1); 0040 int value(const QColor &c); 0041 0042 } 0043 // } 0044 0045 #endif //COLORS_H