This forum has been archived. All content is frozen. Please use KDE Discuss instead.

More perceptual and intuitive color dialog. Some questions…

Tags: None
(comma "," separated)
sommerluk
Registered Member
Posts
12
Karma
0
OS
Hello.

The color dialogs used currently (both in KDE and other environments) are normally not perceptually uniform. They are based usually on RGB or its transforms like HSV. Personally, I think the most intuitive one is the color wheel as used in Gtk. (Example Image) It matches quite well our perception of color. But even there: Why is full saturated yellow at the same position of the triangle as full saturated blue - because yellow is lighter than blue!

I think it would be great to have a color dialog that is perceptually uniform and intuitive. And I think the best model for this purpose is the LCh color space. Of course, this is not a mathematically easy model. But I think it is possible to have an intuitive UI based on LCh without even requiering to user to know anything about LCh, but that “just works”. It might look like this:
Image
Image

LCh is based on hue, lightness and chroma as parameters.

In the first image, you see a widget similar to Gtk's color wheel. First, you choose the hue. Than, you choose lightness and chroma in the image in the middle. But the triangle in the middle is not a perfect triangle, but really an image of the sRGB gamut. Its form varies when the hue changes..

In the second image, you choose first the lightness, and than in the other widget chroma+hue. The form of the color indicator is chosen to make intuitively clearer where is the center (neutral gray/white/black); the indicator's length is the chroma, and its angle the hue.

So I've started to write a library that implements so an interface. Among others, it provides a source-compatible replacement for QColorDialog. It's compiling and working, but not optimized, not not really very clean code. I'm currently reviewing the code myself (clean API, coding style, efficiency…), adding documentation and writing unit tests. About half of the code has yet documentation and got unit tests.

The source code is MIT licensed, available at https://github.com/sommerluk/perceptualcolor and from time to time the API documentation at https://sommerluk.github.io/perceptualcolor/ gets updated. The code links currently against Qt and LittleCMS.

Now I'm at the point where I need some help.

    What might be use cases for such a library? What might be real-world requierements?
    What about color management? I think the dialog is not bad even without real color management (it currently simply assumes sRGB for calculating the gamut images and for diplaying them). But could real color management make things better?
    I do not know how the color management works. In a QWidget::paintEvent(), if I paint RGB 200, 100, 50, what will the monitor display? This exact value? Or will the value be changed if the user has some sort of color management enabled? In short: If I know a Lab/LCh value, how do I get it displayed correctly? Where to find ICC profiles. And: If no profile is found, is sRGB a good alternative?
    Would it be worth to offer (optionally) CMYK color selection? That's something apparently not too common in applications, is it?

Any help is appreciated, especially about how color management works.

Best regards


Lukas Sommer


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kesang, Sogou [Bot], Yahoo [Bot]