My plan was to have two possible argument formats for the rgba function: rgba(r, g, b, a) and rgba(color, a). I think this is the most intuitive input format, and more importantly is easily discoverable. It was what Charles originally thought, for instance. In most cases, it would be used with an RGB hex value; I'd consider the fact that it works with color names and variables a bonus.
I don't like the idea of introducing a new syntax for alpha colors on our own. A CSS-based syntax already exists, and with the new rgba() form it will definitely be easy enough to choose specific alpha values. I don't want to risk potential incompatibility with future CSS syntax additions and make the language diverge more from CSS unnecessarily. On Tue, Jan 26, 2010 at 11:38 AM, Mislav Marohnić <[email protected] > wrote: > On Tue, Jan 26, 2010 at 18:21, Chris Eppstein <[email protected]> wrote: > >> If we want to extend the hex syntax, the extension should be in hex not >> some other value: >> >> #fff7 and #c0c0a07f >> >> Thus, the alpha layer is broken into 256 discrete values between 0 and 1. >> > > Ugh... That came to my mind, but I quickly discarded it. When it comes to > opacity, I think we all think in percentages. Anyway, there's no reason why > a value couldn't be a vector of two different number systems: complex > numbers are real on one axis and imaginary on the other. So a color value > could have a triple hex number as color dimension and a decimal number for > opacity. > > OK, so the dot syntax seems awkward in this case: > > #fff.5 > > But alternate syntaxes are possible: > > #fff^50% > #...@50% > #fff~50% > #fff{.5} > #fff[.5] > > Food for thought. > > -- > You received this message because you are subscribed to the Google Groups > "Haml" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected] <haml%[email protected]>. > For more options, visit this group at > http://groups.google.com/group/haml?hl=en. > -- You received this message because you are subscribed to the Google Groups "Haml" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/haml?hl=en.
