John B. Matthews wrote:
[...]
>
> Would a custom color chooser provide a better abstraction?
Well, that was inspirational! While playing around with the
ColorChooserDemo, and in particular the Hue pane, I began to
wonder how do they possibly expect to get the 255*255*255 RGB
colors with only 360*100*100 when it dawned upon me that the
*hue angle* is cyclic so that there are really 360*6*100*100
HSB values represented in that control! My apparent numerical/
conversion problems were all the result of my misunderstanding
the parameters to Color.getHSB(hsb), I was attempting to
represent the hue parameter as a percentage rather than a hue
angle. Now, armed with that revelation I can simply put a
mapping in between the java.awt.Color conversion methods and
my display and now HSB .5,.5,.5 should equal 128,128,128 RGB. :-)
Thanks,
JH
>
>
> John


|