Discussion:
Review Request: Add support for AlphaChannel to KColorDialog
Johannes Christenson
2010-04-27 13:48:40 UTC
Permalink
I can't see any reason to treat the alpha channel different from other
channels?
Can you clarify? Behavior that you see vs. expected behavior?
I meant that you gave the alpha channel a separate gradient bar
instead of letting it use the one the other channels are using by
selecting it with a radio button.
The color selection is three-dimensional, with two dimension
displayed in the large area, and the third dimension displayed in
the slider next to it. With the radio buttons, you select which
dimension is shown in the slider, and the remaining two are shown in
the large area.
When you add a fourth dimension (which is not actually related to the
color space), and you select this one for the slider, which two of
the remaining three should be displayed in the large area?
You're right! I should have been thinking more before my comment!:)
Although if it's not part of the color space there is little reason
to have it lined up with the rgb values either! But I think that's
ok. The placement would, IMHO, look best if the labels (the text)
where lined up. Have you been thinking about other alternatives for
visualization? (Not criticism! Just brainstorming around the fact
that we actually have four dimensions to visualize and are doing it
in 2+1+1 dimensions. How would it for example look with 2+2
dimensions?) I find this a very interesting subject!
Maybe I should make it my next project to add more color spaces, like
LAB, to the dialog? Though this would have to be thought through so
it doesn't clutter up the dialog. BTW, I definitively like that
you're adding the alpha channel.
I would rather not use 2+2, because the user maybe does not want
alpha to be changed, and that would be very hard this way. Qt's
dialog simply does not offer a slider, it merely adds a spin box
below RGB spin boxes. Additionally, users might associate the "A"
channel with ARGB or RGBA and these were the reasons why I put them
in line with the RGB spin boxes.
Another idea would be to move the slider below the spin boxes
(horizontally), so that it is more visible that it applies both to
RGBA as well as HSVA. This way the actual 3D color selection would
be visually separated from the "A" selection.
.----------------.-------.
| "3D" colorarea | table |
+----------------+-------+
| spin boxes | result|
+----------------+ (color|
| optional Alpha | /HTML)|
'----------------'-------'
Other ideas?
Regarding other color schemes, I would really like to have Qt 4.6's
HSL or even KDE's KCY color modes inside the dialog, maybe even
L*a*b or something else, if it is computationally possible. Or some
wheel that better represents the Hue circularity... But that all
probably requires "color selection widget plugins" to not further
blow kdelibs. The color dialog is already quite big :)
So, what about the API addition? Is the property name
"alphaChannelEnabled" OK? Details about the layout of the widget can
be changed any time.
.-------------.--.-------.
| |C | |
|
| "2D" |o | table |
| colorarea |l | |
+-------------+ +-------+
| Alpha | result|
+----------------+ (color|
| spin boxes | /HTML)|
'----------------'-------'
Might be worth looking at.
"alphaChannelEnabled" is , imho, a good propertyname. If someone
else
thinks differently they should speak up.
Sorry, I meant "suggestion by Johannes", not Christian...
No problem! :-)
The other idea I head was to move the slider between the HSV/ARGB and
the
Alpha spinboxes, but that of course does not look as nice.
- Christoph
-----------------------------------------------------------
http://reviewboard.kde.org/r/3566/#review4996
-----------------------------------------------------------
-----------------------------------------------------------
http://reviewboard.kde.org/r/3566/
-----------------------------------------------------------
(Updated 2010-04-27 13:13:40)
Review request for Gwenview, kdelibs and usability.
Summary
-------
Add an "alphaChannelEnabled" property to KColorDialog to support
QColorDialog::ShowAlphaChannel. Requires the patch from
http://reviewboard.kde.org/r/3565 to show the alpha gradient.
* name/description of newly added methods in KColorDialog
* visible "Alpha" label ("Opacity"?)
* placement of widgets (yes, Alpha label should be aligned to RGB labels,
but how?)
Diffs
-----
/trunk/KDE/kdebase/workspace/qguiplatformplugin_kde/qguiplatformplugin_
kde.cpp 1119552 /trunk/KDE/kdelibs/kdeui/colors/kcolordialog.h 1119552
/trunk/KDE/kdelibs/kdeui/colors/kcolordialog.cpp 1119552
Diff: http://reviewboard.kde.org/r/3566/diff
Testing
-------
#include <QtGui/QApplication>
#include <QtGui/QColorDialog>
#include <QtCore/QDebug>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QColor color = QColorDialog::getColor(QColor(255, 0, 0, 100), 0,
"Select ARGB Color",
QColorDialog::ShowAlphaChannel)
;
qDebug() << color;
}
Screenshots
-----------
KColorDialog with enabled AlphaChannel
http://reviewboard.kde.org/r/3566/s/376/
Thanks,
Christoph
Loading...