|
Packit Bot |
052d53 |
/*************************************************************************
|
|
Packit Bot |
052d53 |
* Copyright (C) 2014 by Hugo Pereira Da Costa <hugo.pereira@free.fr> *
|
|
Packit Bot |
052d53 |
* Copyright (C) 2014-2018 Martin Bříza <m@rtinbriza.cz> *
|
|
Packit Bot |
052d53 |
* Copyright (C) 2019-2020 Jan Grulich <jgrulich@redhat.com> *
|
|
Packit Bot |
052d53 |
* *
|
|
Packit Bot |
052d53 |
* This program is free software; you can redistribute it and/or modify *
|
|
Packit Bot |
052d53 |
* it under the terms of the GNU General Public License as published by *
|
|
Packit Bot |
052d53 |
* the Free Software Foundation; either version 2 of the License, or *
|
|
Packit Bot |
052d53 |
* (at your option) any later version. *
|
|
Packit Bot |
052d53 |
* *
|
|
Packit Bot |
052d53 |
* This program is distributed in the hope that it will be useful, *
|
|
Packit Bot |
052d53 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
Packit Bot |
052d53 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
Packit Bot |
052d53 |
* GNU General Public License for more details. *
|
|
Packit Bot |
052d53 |
* *
|
|
Packit Bot |
052d53 |
* You should have received a copy of the GNU General Public License *
|
|
Packit Bot |
052d53 |
* along with this program; if not, write to the *
|
|
Packit Bot |
052d53 |
* Free Software Foundation, Inc., *
|
|
Packit Bot |
052d53 |
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
|
|
Packit Bot |
052d53 |
*************************************************************************/
|
|
Packit Bot |
052d53 |
|
|
Packit Bot |
052d53 |
#ifndef ADWAITA_COLORS_H
|
|
Packit Bot |
052d53 |
#define ADWAITA_COLORS_H
|
|
Packit Bot |
052d53 |
|
|
Packit Bot |
052d53 |
#include "adwaita.h"
|
|
Packit Bot |
052d53 |
#include "adwaitaqt_export.h"
|
|
Packit Bot |
052d53 |
|
|
Packit Bot |
052d53 |
#include <QColor>
|
|
Packit Bot |
052d53 |
|
|
Packit Bot |
052d53 |
namespace Adwaita
|
|
Packit Bot |
052d53 |
{
|
|
Packit Bot |
052d53 |
|
|
Packit Bot |
052d53 |
class ADWAITAQT_EXPORT Colors
|
|
Packit Bot |
052d53 |
{
|
|
Packit Bot |
052d53 |
public:
|
|
Packit Bot |
052d53 |
// Color adjustments
|
|
Packit Bot |
052d53 |
static QColor alphaColor(QColor color, qreal alpha);
|
|
Packit Bot |
052d53 |
static QColor darken(const QColor &color, qreal amount = 0.1);
|
|
Packit Bot |
052d53 |
static QColor desaturate(const QColor &color, qreal amount = 0.1);
|
|
Packit Bot |
052d53 |
static QColor lighten(const QColor &color, qreal amount = 0.1);
|
|
Packit Bot |
052d53 |
static QColor mix(const QColor &c1, const QColor &c2, qreal bias = 0.5);
|
|
Packit Bot |
052d53 |
static QColor transparentize(const QColor &color, qreal amount = 0.1);
|
|
Packit Bot |
052d53 |
|
|
Packit Bot |
052d53 |
static QPalette disabledPalette(const QPalette &source, qreal ratio);
|
|
Packit Bot |
052d53 |
// Color palette for each Adwaita variant
|
|
Packit Bot |
052d53 |
static QPalette palette(ColorVariant variant = ColorVariant::Unknown);
|
|
Packit Bot |
052d53 |
|
|
Packit Bot |
052d53 |
// Generic colors
|
|
Packit Bot |
052d53 |
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor hoverColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor focusColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor negativeText(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor shadowColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* active
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor titleBarColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* active
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor titleBarTextColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
|
|
Packit Bot |
052d53 |
// Outline colors
|
|
Packit Bot |
052d53 |
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* color role
|
|
Packit Bot |
052d53 |
* color group
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor arrowOutlineColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* mouse over
|
|
Packit Bot |
052d53 |
* has focus
|
|
Packit Bot |
052d53 |
* opacity
|
|
Packit Bot |
052d53 |
* animation mode
|
|
Packit Bot |
052d53 |
* color variant
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor buttonOutlineColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* mouse over
|
|
Packit Bot |
052d53 |
* has focus
|
|
Packit Bot |
052d53 |
* opacity
|
|
Packit Bot |
052d53 |
* animation mode
|
|
Packit Bot |
052d53 |
* checkbox state
|
|
Packit Bot |
052d53 |
* color variant
|
|
Packit Bot |
052d53 |
* in menu
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor indicatorOutlineColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* mouse over
|
|
Packit Bot |
052d53 |
* has focus
|
|
Packit Bot |
052d53 |
* opacity
|
|
Packit Bot |
052d53 |
* animation mode
|
|
Packit Bot |
052d53 |
* color variant
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor frameOutlineColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* mouse over
|
|
Packit Bot |
052d53 |
* has focus
|
|
Packit Bot |
052d53 |
* opacity
|
|
Packit Bot |
052d53 |
* animation mode
|
|
Packit Bot |
052d53 |
* color variant
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor inputOutlineColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* has focus
|
|
Packit Bot |
052d53 |
* opacity
|
|
Packit Bot |
052d53 |
* animation mode
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor sidePanelOutlineColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* mouse over
|
|
Packit Bot |
052d53 |
* has focus
|
|
Packit Bot |
052d53 |
* opacity
|
|
Packit Bot |
052d53 |
* animation mode
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor sliderOutlineColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
|
|
Packit Bot |
052d53 |
// Background colors
|
|
Packit Bot |
052d53 |
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* mouse over
|
|
Packit Bot |
052d53 |
* has focus
|
|
Packit Bot |
052d53 |
* sunken
|
|
Packit Bot |
052d53 |
* opacity
|
|
Packit Bot |
052d53 |
* animation mode
|
|
Packit Bot |
052d53 |
* color variant
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor buttonBackgroundColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* mouse over
|
|
Packit Bot |
052d53 |
* active
|
|
Packit Bot |
052d53 |
* opacity
|
|
Packit Bot |
052d53 |
* animation mode
|
|
Packit Bot |
052d53 |
* color variant
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor checkBoxIndicatorColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* state
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor headerTextColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* mouse over
|
|
Packit Bot |
052d53 |
* has focus
|
|
Packit Bot |
052d53 |
* sunken
|
|
Packit Bot |
052d53 |
* opacity
|
|
Packit Bot |
052d53 |
* animation mode
|
|
Packit Bot |
052d53 |
* checkbox state
|
|
Packit Bot |
052d53 |
* color variant
|
|
Packit Bot |
052d53 |
* in menu
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor indicatorBackgroundColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor frameBackgroundColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* mouse over
|
|
Packit Bot |
052d53 |
* has focus
|
|
Packit Bot |
052d53 |
* sunken
|
|
Packit Bot |
052d53 |
* opacity
|
|
Packit Bot |
052d53 |
* animation mode
|
|
Packit Bot |
052d53 |
* color variant
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor scrollBarHandleColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* color variant
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor separatorColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
* mouse over
|
|
Packit Bot |
052d53 |
* has focus
|
|
Packit Bot |
052d53 |
* sunken
|
|
Packit Bot |
052d53 |
* opacity
|
|
Packit Bot |
052d53 |
* animation mode
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor toolButtonColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
/* Relevant options:
|
|
Packit Bot |
052d53 |
* palette
|
|
Packit Bot |
052d53 |
*/
|
|
Packit Bot |
052d53 |
static QColor tabBarColor(const StyleOptions &options);
|
|
Packit Bot |
052d53 |
};
|
|
Packit Bot |
052d53 |
|
|
Packit Bot |
052d53 |
} // namespace Adwaita
|
|
Packit Bot |
052d53 |
|
|
Packit Bot |
052d53 |
#endif // ADWAITA_COLORS_H
|
|
Packit Bot |
052d53 |
|