[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Color.toWeb & Color.toHexString
From:       pavel.safrata () oracle ! com (Pavel Safrata)
Date:       2012-07-23 13:59:29
Message-ID: 500D58C1.40300 () oracle ! com
[Download RAW message or body]

Yes, I know, the Color.web() parses it as well.
Pavel

On 23.7.2012 15:32, David Grieve wrote:
> Alpha isn't standard in a hex color, but the JavaFX CSS parser will 
> parse #rgba or #rrggbbaa
>
> On Jul 17, 2012, at 4:56 AM, Pavel Safrata wrote:
>
>>
>> On 17.7.2012 6:11, Jim Graham wrote:
>>> I had similar questions to Rich, but I had one additional question:
>>>
>>> On 7/10/2012 7:50 AM, Pavel Safrata wrote:
>>>> public String toHexString()
>>>>
>>>> This method will return a string rrggbb without the leading hash. It
>>>> will ignore opacity and will round the values to the nearest color that
>>>> can be represented with such string. An example of use is displaying a
>>>> web-based color value in a color picker.
>>>
>>> Why ignore opacity?
>>
>> This one is disputable. I based it on the mentioned use-case where 
>> you edit the color in a color picker and I've never seen an 
>> application where opacity would be part of that field. Also AFAIK 
>> expressing opacity as 256-based value is not a common thing at all - 
>> for instance it wouldn't be parsed by any CSS engine, would it? But 
>> I'm not sure this justifies for ignoring the opacity, maybe we should 
>> produce the string expressing the color as close as possible.
>>
>> Thanks,
>> Pavel
>>
>>>
>>>            ...jim
>>
>>
>
> <http://www.oracle.com>
> David Grieve | Principal Member of Technical Staff
> Mobile: +16033121013 <tel:+16033121013>
> Oracle Java Client UI and Tools
> Durham, NH 03824
> <http://www.oracle.com/commitment> Oracle is committed to developing 
> practices and products that help protect the environment
>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic