On Tue, Jan 26, 2010 at 16:03, Charles Roper <[email protected]>wrote:

> 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)
>

You're forgetting that in CSS these are not functions with arguments. They
are various syntaxes for marking up color literals. Sass is a scripting
language and it can have real functions. In a programming language, you
mostly name functions with regard on what they do, not what kind of
arguments they take. Also, in Sass, there is only one color type: color.


> 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)
>

That might be. You would have to pay attention whether you are in Sassscript
or static CSS, which may not be optimal.


> 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()?


We don't need a function. Functions, by definition, map their argument(s) to
some other value. We shouldn't need a function just to enter color values.
What we need is a good syntax. I proposed this in my last email.

In CSS, this is syntax (not function):

    rgba(0,0,0,.5)

We want to be able to specify the same, only with hex. We could do:

    rgba(#000,.5)  or  rgba(black,.5)

But that might be confusing. We could change the name, but—in my
opinion—keeping it simple like:

    #000.5  or  #000%50

…is much nicer.

-- 
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.

Reply via email to