Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
JoVinz
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
Accepted Solution

Problem in createLinearGradientBackground()

[ Edited ]

I am using following method for setting background color. I have R,B and B value  for color which i want.But how can i convert it in 32-Bit 0x00RRGGBB format.

public static Background createLinearGradientBackground(int colorTopLeft,
                                                        int colorTopRight,
                                                        int colorBottomRight,
                                                        int colorBottomLeft)

How can i covert it?



Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: Problem in createLinearGradientBackground()

Your color values will be in the range 0 - 255.  Convert these to hex and then use them.  For example if your red value was 128, then that in hex is 80, if the Green was 16, then that would be 10 in hex and if the Blue was 64, this is 40, so the color value would be 0X00801040.  make sense?

Developer
JoVinz
Posts: 255
Registered: ‎05-03-2012
My Device: 9930

Re: Problem in createLinearGradientBackground()

Thanx peter..its working properly