KDEUI
kcolorutils.h
Go to the documentation of this file.
00001 /* This file is part of the KDE project 00002 * Copyright (C) 2007 Matthew Woehlke <mw_triad@users.sourceforge.net> 00003 * Copyright (C) 2007 Thomas Zander <zander@kde.org> 00004 * Copyright (C) 2007 Zack Rusin <zack@kde.org> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef KCOLORUTILS_H 00023 #define KCOLORUTILS_H 00024 00025 #include <kdeui_export.h> 00026 #include <QtGui/QPainter> 00027 00028 class QColor; 00029 00033 namespace KColorUtils { 00044 KDEUI_EXPORT qreal luma(const QColor&); 00045 00058 KDEUI_EXPORT qreal contrastRatio(const QColor&, const QColor&); 00059 00075 KDEUI_EXPORT QColor lighten(const QColor&, qreal amount = 0.5, qreal chromaInverseGain = 1.0); 00076 00092 KDEUI_EXPORT QColor darken(const QColor&, qreal amount = 0.5, qreal chromaGain = 1.0); 00093 00106 KDEUI_EXPORT QColor shade(const QColor&, qreal lumaAmount, qreal chromaAmount = 0.0); 00107 00120 KDEUI_EXPORT QColor tint(const QColor &base, const QColor &color, qreal amount = 0.3); 00121 00133 KDEUI_EXPORT QColor mix(const QColor &c1, const QColor &c2, 00134 qreal bias = 0.5); 00135 00148 KDEUI_EXPORT QColor overlayColors(const QColor &base, const QColor &paint, 00149 QPainter::CompositionMode comp = QPainter::CompositionMode_SourceOver); 00150 00151 } 00152 00153 #endif // KCOLORUTILS_H 00154 // kate: space-indent on; indent-width 4; replace-tabs on; auto-insert-doxygen on;
KDE 4.6 API Reference