ember-paper: Error: argument `$color` of `rgba($color, $alpha)` must be a color
I got error this during a clean install of my master which was working.
In my package.json I had "ember-paper": "^1.0.0-alpha.20",
and I’m using ember 2.12.2.
I removed the caret to set the version to exactly 1.0.0-alpha.20 and it fixed the error.
This must be an issue with the new version of ember-paper: 1.0.0-beta.1.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 20 (9 by maintainers)
Yes.
contrastDefaultColoris the newconstrast. For future reference, I’ll explain this change here.We now have a much more powerful method for contrast colors. Basically, a palette has all the information it needs to know what contrast color a specific shade needs.
So, a palette can have:
contrastDefaultColor- the contrast color that is returned - you can specify any color, but the standard contrast colors are$light-contrast-color,$dark-contrast-colorand$strong-light-contrast-colorcontrastDarkColors- the shades of the palette that have$dark-contrast-coloras its contrast color. This lets you override the default color for the shades you specify here.contrastLightColors- the shades of the palette that have$light-contrast-coloras its contrast color. This lets you override the default color for the shades you specify here.contrastStrongLightColors- the shades of the palette that have$strong-light-contrast-coloras its contrast color. This lets you override the default color for the shades you specify here.Any of the last 3 can take a sass list of strings, e.g
'contrastLightColors': ('600', '700', '800', '900', 'A700'). You can take a look at the palettes file to see the built-in palettes: https://github.com/miguelcobain/ember-paper/blob/master/app/styles/color-palette.scssThis allows me to introduce the new
colorContrastfunction. This function uses all of this information to return a contrast color given a specific color. It acts as the counterpart of thecolorfunction.For example, if you want some element with the primary color and some text on it you can use:
This makes sure that the text will use the correct contrast according to the information in the palette.
I think this is a very powerful system, and lets me focus on colors globally, and not on a case by case basis.