Please add subtract_color(minuend, subtrahend) to allow porting code relying on color subtraction to sass-4 more easily
See original GitHub issueWhen I try to compile this on sass-4 (dart-sass), I get an error:
.a {
x: white - grey;
}
Error: Undefined operation "white - grey".
x: white - grey;
^^^^^^^^^^^^
- 2:6 root stylesheet
I found that to port my code, I had to write this, which is quite WET (see how many times I have to write grey) and tedious:
.a {
x: adjust_color(white, $red: -(red(grey)), $green: -(green(grey)), $blue: -(blue(grey)));
}
May a subtract_color(minuend, subtrahend)
be added which implements the sass-3 color minus color
support to enable easier porting of sass-3 code to sass-4? I can always write one myself for my own code, but I think it should be core.
Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Physics Tutorial: Color Subtraction
To answer this question, the process of color subtraction will be applied once more. In this situation, we begin with only blue and...
Read more >Color Addition and Subtraction - YouTube
Your browser can't play this video. Learn more. Switch camera.
Read more >Color Subtraction - YouTube
The interaction between light and the surface upon which it lands is discussed, with the interest of explaining why objects appear the color...
Read more >OpenGL ES 2.0 colour subtraction - Stack Overflow
If I understand correctly, you need a value within 0 to 1 inclusive-float to subtract from an already existing colour component's value.
Read more >How Do Primary Colors Combine to Make New Colors?
As more colors of paint are mixed in, more colors are subtracted, and the mixture ... In this science fair project, you will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We’re removing color arithmetic because it doesn’t mean anything in terms of actual colors as humans perceive them, and we want to encourage users to use the color functions that do have comprehensible semantics. Adding new functions to do the same thing would defeat that purpose. As far as migration goes, it’s pretty easy to write your own functions that do the same thing as arithmetic, as you’ve demonstrated.
I think I would expect such functions to match the behavior provided by the following:
output: