sivarajankumar / google-web-toolkit-incubator

Automatically exported from code.google.com/p/google-web-toolkit-incubator
0 stars 0 forks source link

com.google.gwt.widgetideas.graphics.client.Color has no internal representation of color and is hard to manipulate. #356

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
If you want to see this feature/enhancement implemented, please star this 
issue by clicking on the star in the upper left hand corner of this page.

== Enhancement Description ==

Because the Color class has no internal representation of the color (i.e. 
r, g, b, a values), it is difficult to manipulate colors.  I realize this 
is not meant to be an exhaustive implementation of a Color class, but I 
would like to see the ability to create a color as r, g, b (, a) or 
colorstr, and to be able to get the colorstr as either hex or rgb() format 
(regardless of the way it was constructed if colorstr was used), and the 
ability to get individually, the r, g, b, and a values.  For my project I 
have only needed the ability to create a colors as (r,g,b,a) and then use 
them in com.google.gwt.widgetideas.graphics.client.GWTCanvas.  I have 
modified the codes for my needs and can contribute my code if desired.  It 
is not a big departure from the current implementation, I have only changed 
the way the default color constants are represented (i.e., all as r, g, b, 
a instead of colorstr), added internal storage of r, g, b, a, and added 
methods to expose r, g, b, a.  I believe it should be fully backwards 
compatible with the current implementation.

Original issue reported on code.google.com by gtsco...@gmail.com on 21 May 2010 at 3:20