RGBA colors

23 views
Skip to first unread message

Lukasz

unread,
Nov 3, 2011, 8:56:20 PM11/3/11
to mat...@googlegroups.com
Is there a way to create palettes or color schemes where you can include a gradient alpha component? Specifically looking for something like the jet color scheme "BbcyrR" in a density plot where the blue side fades off to 0 alpha, and 'c' to 'R' has an alpha of say 0.7. This is to overlay the density plot with reference a photo in the background.

Alexey Balakin

unread,
Nov 4, 2011, 7:50:01 AM11/4/11
to mat...@googlegroups.com
04.11.2011 04:56, Lukasz пишет:
Is there a way to create palettes or color schemes where you can include a gradient alpha component? Specifically looking for something like the jet color scheme "BbcyrR" in a density plot where the blue side fades off to 0 alpha, and 'c' to 'R' has an alpha of say 0.7. This is to overlay the density plot with reference a photo in the background.
Dear Lukasz,

No, there is no such gradients by default. And I'm not sure what one need it. At least its specification will be rather complicated.

However, there are 2 hints.

First one is usage of functions SurfA() for 2D data or Surf3A() for 3D data. They produce a plot (surface or isosurface correspondingly) which transparency depend on the array value. In fact, it give you alpha channel in color scheme.

Second one is changing the color values (which include alpha channel as well) for color ids. But this can be done only from C++ and this will influence for ALL color with the same id.
-- 
All the best,
Alexey Balakin

Lukasz

unread,
Nov 4, 2011, 6:16:41 PM11/4/11
to mat...@googlegroups.com
Thanks, using SurfA sounds like the perfect solution. As for the second hint, I noticed there is an mglColor class with ability to change the alpha, but I'm not sure how to tie that into the rest of the framework.

mathgl....@gmail.com

unread,
Nov 7, 2011, 4:30:57 AM11/7/11
to mat...@googlegroups.com
2011/11/5 Lukasz <lwik...@gmail.com>:

> Thanks, using SurfA sounds like the perfect solution. As for the second
> hint, I noticed there is an mglColor class with ability to change the alpha,
> but I'm not sure how to tie that into the rest of the framework.

Uff, it is not so easy -- you need to create yours own array of type
mglColorID and replace the standard array by new one in mglColorIds
(defined in mgl/mgl.h).

Reply all
Reply to author
Forward
0 new messages