bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Add Color::TRANSPARENT

Open GuillaumeGomez opened this issue 3 years ago • 6 comments

I was looking for a fully transparent Color and only realize after a long while that Color::NONE was what I was looking for. This is really just a commodity because I think some other people have have stumbled on this. If you think it's useless, please close the PR.

GuillaumeGomez avatar Nov 09 '22 22:11 GuillaumeGomez

Did you commit the right thing? I'm not sure the code is related to adding a new Color

IceSentry avatar Nov 09 '22 22:11 IceSentry

... I pushed to the wrong branch. I was updating https://github.com/bevyengine/bevy/pull/6001 in parallel. Fearless concurrency isn't a thing with git. :laughing:

GuillaumeGomez avatar Nov 09 '22 22:11 GuillaumeGomez

so... what color is transparent? 🤔

mockersf avatar Nov 09 '22 22:11 mockersf

Well, at least in french we say "this glass is transparent", so I guess it's a color? ^^'

GuillaumeGomez avatar Nov 09 '22 22:11 GuillaumeGomez

Is it pertinent to display a colored square in the doc ? I know it's for the sake of consistency, but it's a bit confusing.

image

tguichaoua avatar Nov 10 '22 13:11 tguichaoua

I took the same HTML as for NONE. So if it's unwanted, I can remove it for both.

GuillaumeGomez avatar Nov 10 '22 15:11 GuillaumeGomez

From my perspective, "transparent" is not a specific color, it is any color with an alpha value of 0.0. There are color algorithms (ex: blending) where the RGB values of a "fully transparent" color matter (ex: in this PR you chose a "black" transparency, but "white" transparency is often equally valid / desirable).

Imo exposing this concept is a lossy abstraction that could cause actual harm.

cart avatar Nov 14 '22 22:11 cart

One question: would you accept to add a "doc alias" on Color::NONE so that it is displayed when looking for "transparent"? I can send a PR for that too.

GuillaumeGomez avatar Jan 11 '23 16:01 GuillaumeGomez

One question: would you accept to add a "doc alias" on Color::NONE so that it is displayed when looking for "transparent"? I can send a PR for that too.

I'd merge that in a heartbeat.

alice-i-cecile avatar Jan 11 '23 16:01 alice-i-cecile

Thanks for the quick answer. Then here we go!

GuillaumeGomez avatar Jan 11 '23 16:01 GuillaumeGomez