QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
qgscolorutils.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscolorutils.h
3 ---------------------------
4 begin : July 2022
5 copyright : (C) 2022 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSCOLORUTILS_H
19#define QGSCOLORUTILS_H
20
21#include "qgis_core.h"
22#include "qgis_sip.h"
23#include "qgis.h"
24
25#include <QDomDocument>
26#include <QDomElement>
27#include <QColorSpace>
28
30
37class CORE_EXPORT QgsColorUtils
38{
39 public:
40
55 static void writeXml( const QColor &color, const QString &identifier,
56 QDomDocument &document, QDomElement &element, const QgsReadWriteContext &context );
57
70 static QColor readXml( const QDomElement &element, const QString &identifier, const QgsReadWriteContext &context );
71
82 static QString colorToString( const QColor &color );
83
96 static QColor colorFromString( const QString &string );
97
109 static QColorSpace iccProfile( const QString &iccProfileFilePath, QString &errorMsg SIP_OUT );
110
117 static QString saveIccProfile( const QColorSpace &colorSpace, const QString &iccProfileFilePath );
118
119
120#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
121
129 static Qgis::ColorModel toColorModel( QColorSpace::ColorModel colorModel, bool *ok = nullptr ) SIP_SKIP;
130
131#endif
132
133};
134
135#endif // QGSCOLORUTILS_H
ColorModel
Color model types.
Definition qgis.h:5570
Contains utility functions for working with colors.
The class is used as a container of context for various read/write operations on other objects.
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_OUT
Definition qgis_sip.h:58