Perceptual Color

How to get started

How to get started? PerceptualColor::ColorDialog provides a perceptual replacement for QColorDialog:

// Show a modal color dialog and get the color that the user has chosen

This is a minimal, but complete example project showing how to use this library:

CMakeLists.txt:

cmake_minimum_required(VERSION 3.16)
project(example)
find_package(
"perceptualcolor-0"
REQUIRED)
add_executable(example)
target_sources(example PRIVATE example.cpp)
target_link_libraries(
example
PRIVATE PerceptualColor::perceptualcolor-0)

example.cpp:

#include <colordialog.h>
#include <qapplication.h>
#include <qcolordialog.h>
#include <rgbcolorspacefactory.h>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
PerceptualColor::ColorDialog m_colorDialog(myColorSpace);
m_colorDialog.setOption(QColorDialog::ColorDialogOption::ShowAlphaChannel);
m_colorDialog.show();
return app.exec();
}
A perceptually uniform color picker dialog.
static QSharedPointer< PerceptualColor::RgbColorSpace > createSrgb()
Create an sRGB color space object.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:51:26 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.