Home » U++ Library support » U++ Core » Color and RGBA
Color and RGBA [message #35485] |
Wed, 22 February 2012 12:24 |
|
I know this topic was discussed some (long) time ago, but do we really have those two different structures? It makes things more complicated especially if one uses rainbow renderer that supports transparency but due to draw interface he cannot easily use it.
For example I would like to paint transparent red rectangle. Normally I would do:
void Paint(Draw& w) {
w.DrawRect(10, 10, 100, 100, Color(Red, 128));
}
Instead I need to cast draw to SystemDraw. In framebuffer it lookes like this:
void Paint(Draw& w) {
SystemDraw& sw = (SystemDraw&) w;
col.r = Red().GetR();
col.g = Red().GetG();
col.b = Red().GetB();
col.a = 128;
sw.RectPath(10, 10, 100, 100).Fill(col);
}
In WinGL
void Paint(Draw& w) {
SystemDraw& sw = (SystemDraw&) w;
sw.alpha = 128;
sw.DrawRect(10, 10, 100, 100, Red);
}
Could not Color simply support transparency as RGBA? (in rainbow backend without transparency this part of information from Color would be simply ignored (not used))
PS: I also wonder if it wouldn't be better if Draw interface used doubles instead of integers as coordinates)
|
|
|
|
|
Color and RGBA
By: unodgs on Wed, 22 February 2012 12:24
|
|
|
Re: Color and RGBA
By: mirek on Thu, 23 February 2012 20:52
|
|
|
Re: Color and RGBA
By: unodgs on Thu, 23 February 2012 22:40
|
|
|
Re: Color and RGBA
By: Tom1 on Thu, 23 February 2012 22:49
|
|
|
Re: Color and RGBA
By: unodgs on Fri, 24 February 2012 08:06
|
|
|
Re: Color and RGBA
By: Tom1 on Fri, 24 February 2012 13:32
|
|
|
Re: Color and RGBA
By: mirek on Fri, 24 February 2012 14:03
|
|
|
Re: Color and RGBA
By: mirek on Fri, 24 February 2012 14:05
|
|
|
Re: Color and RGBA
By: Tom1 on Fri, 24 February 2012 14:57
|
|
|
Re: Color and RGBA
By: mirek on Fri, 24 February 2012 15:40
|
|
|
Re: Color and RGBA
By: mirek on Sun, 04 March 2012 00:29
|
Goto Forum:
Current Time: Sun Apr 28 23:07:29 CEST 2024
Total time taken to generate the page: 0.04963 seconds
|