View mode: basic / threaded / horizontal-split · Log in · Help
June 23, 2008
awt.Color.getHSBColor to DWT ?
SWT:
java.awt.Color color = java.awt.Color.getHSBColor(0.2f, 1.0f, 1.0f);
Color myColor = new Color(display, color.getRed(), color.getGreen(), color.getBlue());

How do thing like this in DWT? 
Does have a method like getHSBColor in DWT?



-- 
yidabu <yidabu.spam@gmail.com>
http://www.dsource.org/projects/dwin

D 语言-中文(D Chinese):
http://www.d-programming-language-china.org/
http://bbs.d-programming-language-china.org/
http://dwin.d-programming-language-china.org/
http://scite4d.d-programming-language-china.org/
June 23, 2008
Re: awt.Color.getHSBColor to DWT ?
On Mon, 23 Jun 2008 09:03:33 +0800
yidabu <yidabu.spam@gmail.com> wrote:

> SWT:
> java.awt.Color color = java.awt.Color.getHSBColor(0.2f, 1.0f, 1.0f);
> Color myColor = new Color(display, color.getRed(), color.getGreen(), color.getBlue());
> 
> How do thing like this in DWT? 
> Does have a method like getHSBColor in DWT?

I got it,
to DWT, should be:
auto rgb = new RGB(0.2f * 360, 1.0f, 1.0f);
Color myColor = new Color(display, rgb.red, rgb,green, rgb.blue);

or 
auto myColor = new Color(display, new RGB(0.2f * 360, 1.0f, 1.0f));




-- 
yidabu <yidabu.spam@gmail.com>
http://www.dsource.org/projects/dwin

D 语言-中文(D Chinese):
http://www.d-programming-language-china.org/
http://bbs.d-programming-language-china.org/
http://dwin.d-programming-language-china.org/
http://scite4d.d-programming-language-china.org/
Top | Discussion index | About this forum | D home