RE: Converting a Color object to its string representation

2023-12-23 Thread Eran Leshem
Yes, exactly what I would like every client to avoid writing. Eran From: Nir Lisker [mailto:nlis...@gmail.com] Sent: Saturday, December 23, 2023 9:24 PM To: Eran Leshem Cc: Kevin Rushforth; openjfx-dev@openjdk.org Subject: Re: Converting a Color object to its string representation I

Re: Converting a Color object to its string representation

2023-12-23 Thread Nir Lisker
ay, December 13, 2023 2:46 PM > *To:* openjfx-dev@openjdk.org > *Subject:* Re: Converting a Color object to its string representation > > > > Or the third option: > > 3. Do nothing > > I would go for option 1 or 3. I do not recommend option 2. > > I see some value in a m

RE: Converting a Color object to its string representation

2023-12-16 Thread Eran Leshem
[mailto:openjfx-dev-r...@openjdk.org] On Behalf Of Kevin Rushforth Sent: Wednesday, December 13, 2023 2:46 PM To: openjfx-dev@openjdk.org Subject: Re: Converting a Color object to its string representation Or the third option: 3. Do nothing I would go for option 1 or 3. I do not recommend option 2

Re: Converting a Color object to its string representation

2023-12-13 Thread Kevin Rushforth
le methods or via an enum parameter Eran *From:*openjfx-dev [mailto:openjfx-dev-r...@openjdk.org] *On Behalf Of *Andy Goryachev *Sent:* Tuesday, December 12, 2023 6:08 PM *To:* Scott Palmer; openjfx-dev@openjdk.org *Subject:* Re: Converting a Color object to its string representation I also thi

RE: Converting a Color object to its string representation

2023-12-12 Thread Eran Leshem
multiple methods or via an enum parameter Eran From: openjfx-dev [mailto:openjfx-dev-r...@openjdk.org] On Behalf Of Andy Goryachev Sent: Tuesday, December 12, 2023 6:08 PM To: Scott Palmer; openjfx-dev@openjdk.org Subject: Re: Converting a Color object to its string representation I also

Re: Converting a Color object to its string representation

2023-12-12 Thread Andy Goryachev
, 2023 at 17:12 To: openjfx-dev@openjdk.org Subject: Re: Converting a Color object to its string representation I agree. I was going to write pretty much this exact email, but you beat me to it. I was implementing some user-configurable colour customizations in an application and needed to do it

Re: Converting a Color object to its string representation

2023-12-11 Thread Scott Palmer
to provide the inverse conversion. > > Eran > > -Original Message- > From: openjfx-dev [mailto:openjfx-dev-r...@openjdk.org] On Behalf Of John > Hendrikx > Sent: Saturday, December 09, 2023 11:35 PM > To: openjfx-dev@openjdk.org > Subject: Re: Converting a Color

RE: Converting a Color object to its string representation

2023-12-11 Thread Eran Leshem
To: openjfx-dev@openjdk.org Subject: Re: Converting a Color object to its string representation I think this is too niche to have Color provide. Just make a utility method for whatever format you desire, instead of making Color responsible for half a dozen ways of formatting colors, and then

Re: Converting a Color object to its string representation

2023-12-09 Thread John Hendrikx
I think this is too niche to have Color provide. Just make a utility method for whatever format you desire, instead of making Color responsible for half a dozen ways of formatting colors, and then probably still missing some format that someone needs. Ticket should be closed as won't fix. --

Re: Converting a Color object to its string representation

2023-12-09 Thread Michael Strauß
I obviously meant to write withPrefix("#"), not withDelimiter("#")... On Sat, Dec 9, 2023 at 9:57 PM Michael Strauß wrote: > > How would HexFormat work with Color, other than using an extremely > unwieldy syntax? > > String formatted = HexFormat.of() > .withDelimiter("#") > .f

Re: Converting a Color object to its string representation

2023-12-09 Thread Michael Strauß
How would HexFormat work with Color, other than using an extremely unwieldy syntax? String formatted = HexFormat.of() .withDelimiter("#") .formatHex(new byte[] { (byte)(color.getRed() * 255.0f), (byte)(color.getGreen() * 255.0f), (byte)(color

Re: Converting a Color object to its string representation

2023-12-09 Thread David Alayachew
Apologies - java.util.HexFormat That's what I get for firing from the hip, then looking afterwards. On Sat, Dec 9, 2023, 3:38 PM David Alayachew wrote: > Doesn't HexDigits cover 3/4 of these cases? > > On Sat, Dec 9, 2023, 1:20 PM Michael Strauß > wrote: > >> If we are going to revisit the `Co

Re: Converting a Color object to its string representation

2023-12-09 Thread David Alayachew
Doesn't HexDigits cover 3/4 of these cases? On Sat, Dec 9, 2023, 1:20 PM Michael Strauß wrote: > If we are going to revisit the `Color` class, maybe we want to provide > a more comprehensive string formatting API, for example: > - full-length web strings (e.g. "#ffad341c") > - compact web string

Re: Converting a Color object to its string representation

2023-12-09 Thread Michael Strauß
If we are going to revisit the `Color` class, maybe we want to provide a more comprehensive string formatting API, for example: - full-length web strings (e.g. "#ffad341c") - compact web strings (e.g. "#ccc") - with/without the leading # - nearest named color ("darkgoldenrod") On Sat, Dec 9, 2023

Converting a Color object to its string representation

2023-12-09 Thread Eran Leshem
Hello, Can I contribute an implementation for https://bugs.openjdk.org/browse/JDK-8090778? Eran