Hello,
Is there a version of TColorDialog which allows to specify an Alpha channel ?
Michael.

Mailing lists / lazarus / 2018-03
18 messages · 7 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hello,
Is there a version of TColorDialog which allows to specify an Alpha channel ?
Michael.
Michael Van Canneyt wroteIs there a version of TColorDialog which allows to specify an Alpha channel ?
Not in the LCL itself. Maybe you can try to build one using http://wiki.lazarus.freepascal.org/mbColorLib#RGB_color_pickers
I didn't use it myself, it just popped up in a Google search.
Ondrej
Hm. I didn't find that. Must have used the wrong terms. However, none of them seems to support Alpha.
It looks like I will have to make one myself :(
Michael.
Not in the LCL itself. Maybe you can try to build one using…
Ondrej Pokorny wroteNot in the LCL itself. Maybe you can try to build one using http://wiki.lazarus.freepascal.org/mbColorLib#RGB_color_pickers
I did the port to Lazarus. But no - none of them supports an alpha channel, they focus on color selection based on a variety of color models. Maybe you should have a look at BGRABitmap and associated controls.
Looking at the demo of the mbColorLib again after some time I see now a terrible flicker on Windows. Ondrej, I fear your change in double-buffering killed a majority of third-party components. It may take some time until all authors will fix this (and most of them left their babies...).
Werner
Hello,
native TColorDialog in Qt4 has slider and edit for Alpha channel but this value is never in the result (i.e. TColorDialog.Color property). TColor uses upper 8 bits for other purposes than alpha.
V.
I've written a pascal version of some color controls which I've ported to Lazarus. Here is a link to a page with demo video:
https://www.codebot.org/delphi/?doc=9524
These controls includes a hue picker that has 2 styles (radial as shown and bar), a saturation pick again with 2 styles, and an alpha picker. I also have a color value slider edit box, where you can type out a R, G, B values in bytes or floats, and it has a drop down with a left right slider that shows you the colors.
They should be enough to create a decent pascal native color picker. Quick example, adding the alpha picker and drop down edit is trivial:
https://s3.amazonaws.com/cache.codebot.org/videos/color-lazarus-example.mp4 -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180322/14dd8cd1/attachment.html>
Hm. I didn't find that. Must have used the wrong terms. However, none of them seems to…
This is exactly what I meant by "you can try to build one using ...". It shouldn't be that hard - just use the color picker you like (e.g. THSColorPicker) and put a spinedit next to it for the alpha channel value.
Ondrej
Since I don't want dependencies on other packages - only the LCL can be used
- this is not an option...
Michael.
I did the port to Lazarus. But no - none of them supports an alpha channel, they focus on…
Why killed? You can still set the DoubleBuffered property to True.
In 1.8 the DoubleBuffered property was ignored on Windows for all controls. Instead DoubleBuffered=True was forced without the chance to disable it. I.e. the property was absolutely useless since it is not used on Linux/OSX either.
I just disabled the forced DoubleBuffered=True - the same what Delphi does. The only thing LCL misses is ParentDoubleBuffered that makes things easier.
If you don't like the Delphi way but like the Lazarus 1.8 way - it's a valid scenario as well, but then the DoubleBuffered property should be deprecated/removed and DoubleBuffered should be handled automatically with protected methods to override the default behavior.
If you want to discuss it, it will be better to open a new thread.
Ondrej
Is there a version of TColorDialog which allows to specify an Alpha channel ? Michael.
Qt4/Qt5 ws have alpha option in standard color dialog.
zeljko
That's no good to me. It needs to work on all platforms, all widgetsets.
This is lazarus, after all - it should work on all supported platforms.
Michael.
Well, Qt works on all supported desktop platforms :)
zeljko
Oh please, you know what I meant :)
s/platforms/platforms+widgetsets/g :)
Michael.
On 03/23/2018 10:27 AM, Michael Van Canneyt via Lazarus wrote: ported platforms.
Of course I know :)
zeljko
Since I don't want dependencies on other packages - only the LCL can be used - this is…
Michael Van Canneyt wroteSince I don't want dependencies on other packages - only the LCL can be used - this is not an option...
Unfortunately LCL always uses native widgets - including dialogs. Non-native and custom widgets (that are not in the VCL) are left for 3rd party vendors. The Lazarus CCR (where mbColorLib is hosted) is a good place for such 3rd party custom components. E.g. virtual tree view and fpspreadsheet are hosted there as well. I am sure you can get commit rights for it if you want to improve libraries stored there.
If you like to write your own alpha channel color dialog (based on mbColorLib or not), you are welcome to host it on LazarusCCR as well.
Ondrej
I need it for FPReport, meaning it must be in Lazarus itself, so I will write a minimalistic dialog that supports Alpha and include it in the report designer package.
Michael.
Michael Van Canneyt wroteI need it for FPReport, meaning it must be in Lazarus itself, so I will write a minimalistic dialog that supports Alpha and include it in the report designer package.
Yes, that makes sense. In Lazarus itself the same problem is solved by selecting the color and alpha channel independently:
But I am aware it doesn't need to suit your needs either.
Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180323/1d12befd/attachment-0001.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: nchanealnhaieffg.png
Type: image/png
Size: 32106 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180323/1d12befd/attachment-0001.png>
That's no good to me. It needs to work on all platforms, all widgetsets. This is lazarus,…
Michael Van Canneyt wroteThis is lazarus, after all - it should work on all supported platforms.
ROFL.
Sorry, I couldn't resist. ;-)
Regards,
Graeme