Yes, good points, I see where you're coming from. The reason I suggest
hexa is because it seems to be a CSS convention that the  name of a
colour function implies what arguments the function should take, or at
least the colour model of the input; e.g.,

rgb(255,0,0)
rgba(255,0,0,.5)
rgb(100%,0%,0%)
rgba(100%, 50%, 0%, 0.5)
hsl(120, 100%, 50%)
hsla(240, 100%, 50%, 0.5)

Because of this, I would guess that most designers would intuitively
assume a function called rgba() would accept only rgb and an alpha
channel, just like the 'real' rgba. But then again, I'm not sure what
the convention is for Sass on function names. I would be inclined to
go with whatever is most intuitive from a CSS author's standpoint.

Another point to consider: if rgba is used as the Sass function name,
then there could be confusion between the following:

rgba(100%, 50%, 0%, 0.5)
rgba(100, 50%, 0%, 0.5)

The first would output an rgba value but the second would output an
hsla value. The only difference between these two is one percentage
symbol.

If we really do want a universal colour function that can take colour
values in any style, the surely the function should be called color(),
colora(), or cola()?

Charles

2010/1/26 Mislav Marohnić <mislav.maroh...@gmail.com>:
> On Tue, Jan 26, 2010 at 13:48, Charles Roper <reac...@charlesroper.co.uk>
> wrote:
>>
>> Thanks Mislav. I considered just using rgba rather than hexa, but with
>> rgba, it is suggesting that rgb values should be used.
>
> My function is named `rgba` not because it expects R,G,B input (quite the
> contrary), but because it outputs a "rgba(r,g,b,a)" CSS string. So you see,
> the title is descriptive.
> Regarding `hexa`, it's a nice short name, but I don't see why a function
> should be named according to input type. Sass script recognizes multiple
> syntaxes for specifying colors, but internally all colors are just colors.
> If `hexa()` function existed, I could write the color argument in a syntax
> other than hexadecimal and it will still work.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Haml" group.
> To post to this group, send email to h...@googlegroups.com.
> To unsubscribe from this group, send email to
> haml+unsubscr...@googlegroups.com.
> 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 h...@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to