JohnAlbin / chroma

Chroma: The Sass color manager
http://johnalbin.github.io/chroma/
GNU General Public License v2.0
40 stars 7 forks source link

add-colors and rgb output. #49

Open ghost opened 8 years ago

ghost commented 8 years ago

I'm trying to define colours using rgb instead of hex. Is this possible?

Whenever I do something like rgb(0, 0, 0) it works but when I try:

unquote('rgb(#{$color-black})')

($color-black being "0,0,0")

I get the error

Message:
    node_modules/chroma-sass/sass/chroma/_functions.scss
Error: The color "rgb(0,0,0)" was not found when adding the color "black".
        on line 401 of node_modules/chroma-sass/sass/chroma/_functions.scss
>>         @error 'The #{$_chroma-spelling} "#{$ref}" was not found when adding t
   --------^
JohnAlbin commented 8 years ago

I can't tell what you are trying to do. Can you give an example where you use one of Chroma's functions and it doesn't work?

This works fine, btw:

$chroma: add-colors((
  black: rgb(0,0,0),
  black-50: ('black' rgba .5), // Outputs rgba(255, 255, 255, 0.5)
));