You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using css-colors, I would like to create a function that takes any color, whether it is RGB or HSL:
fndarken(c:Color){
c.darken(percent(10))}
However, this doesn't work, because the trait Color has an Alpha type, which is not specified in this case. The compiler gives an error:
error[E0191]: the value of the associated type `Alpha` (from the trait `css_colors::Color`) must be specified
--> src/main.rs:12:14
|
12 | fn darken(c: Color) {
| ^^^^^ associated type `Alpha` must be specified
Is there any way around this? Should there be two traits, one for any color and one for colors that can be converted to alpha?
The text was updated successfully, but these errors were encountered:
When using css-colors, I would like to create a function that takes any color, whether it is RGB or HSL:
However, this doesn't work, because the trait Color has an Alpha type, which is not specified in this case. The compiler gives an error:
Is there any way around this? Should there be two traits, one for any color and one for colors that can be converted to alpha?
The text was updated successfully, but these errors were encountered: