- From: Marat Tanalin <mtanalin@yandex.ru>
- Date: Fri, 09 Sep 2011 19:46:26 +0400
- To: Patrick Garies <pgaries@fastmail.us>
- Cc: Tab Atkins Jr. <jackalmage@gmail.com>,www-style@w3.org
> Unfortunately, CSS is locked into the confusing |#RRGGBBAA| syntax since > backward-compatibility with programs that already support this syntax > was part of the rationale for its inclusion. What exact programs you are talking about? For example, in Photoshop, opacity and nontransparent hex color are separate properties that needs to be copied separately anyway. > Adding a full stop (i.e., ".") character as a separator within the > syntax would break that compatibility. It's unclear what compatibility you are talking about, but just in case: point in my proposed syntax is decimal point of full fractional number (from 0.0 to 1.0). Integer part of number is just removed since it's needed only for exactly one opacity value: 1.0. But for 100% opacity we don't need for opacity component at all. So we can safely remove integer part and elegantly use decimal point itself as a compact hex/alpha separator. 07.09.2011, 07:06, "Patrick Garies" <pgaries@fastmail.us>: > On 9/6/2011 2:26 PM, Marat Tanalin wrote: > >> �2. As for alpha opacity. The only reason why RGB components can be >> �represented as hex is that each RGB component has exactly 256 >> �possible values _by nature_. But this has NOTHING TO DO with opacity. >> �Opacity is always specified as decimal number: for example in >> �"opacity" CSS-property, opacity in "rgba()" CSS-function, or >> �percentage transparency in Photoshop. So, hex representation is not >> �only nonapplicable to opacity values, but just inconsistent with >> �existing opacity values notation. Therefore, opacity should be kept >> �specified as a decimal number and is not a subject to shorten at >> �all. >> >> �Exact possible syntax for adding alpha-opacity to hex colors is >> �following: >> >> �#cad8d9.0 ��-- zero opacity; #cad8d9.27 �-- 27% opacity; #cad8d9.275 >> ��-- 27.5% opacity; #cad8d9 ����-- 100% opacity (no need for opacity >> �component at all, using just regular hex value.). > > Unfortunately, CSS is locked into the confusing |#RRGGBBAA| syntax since > backward-compatibility with programs that already support this syntax > was part of the rationale for its inclusion. I believe the idea is that > you'll be able to copy and paste such values directly into a style sheet. > > Adding a full stop (i.e., ".") character as a separator within the > syntax would break that compatibility.
Received on Friday, 9 September 2011 15:47:00 UTC