less-docs icon indicating copy to clipboard operation
less-docs copied to clipboard

Update color-definition.md

Open LordPachelbel opened this issue 3 years ago • 2 comments

rgba() can do a lot more than what is documented, which I only just today discovered when, out of curiosity, I tested whether it could convert RGBA hex notation to RGBA.

LordPachelbel avatar Jul 02 '21 16:07 LordPachelbel

@LordPachelbel Just to explain, there are two behaviors you're discovering here.

  1. #RRGGBBAA notation is supported, by itself
  2. It's not that rgba has a secret way to convert #RRGGBBAA, it's that if you pass a color as the first param, it will return said color. That's to support rgba([color], [opacity]) notation, but opacity is optional (hence the behavior you're seeing). hsla() has the same behavior.

So it's basically:

  1. Color in -> color out for rgba and hsla (as well as rgb and hsl ?)
  2. #RRGGBBAA is a color

So the documentation may want to reflect that.

matthew-dean avatar Jul 02 '21 18:07 matthew-dean

LordPachelbel:patch-1

Baro1905 avatar Apr 09 '22 14:04 Baro1905