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
Currently I'm using color: hsl(hue(@black), saturation(@black), 100 - lightness(@black));
to invert colors but color: invert(@color)
would be much better syntax for the job.
The code for function:
invert: function (color) {
var rgb = [255 - color.rgb[0],
255 - color.rgb[1],
255 - color.rgb[2]];
return new(tree.Color)(rgb);
},
I tested it with less.js 1.2.1 so it works
The text was updated successfully, but these errors were encountered:
Not really the negation. The javascript code posted by @Oskariok is simple Less (#fff - @color) or equal difference(#fff, @color). However the Less code suggested by @ascottmccauley later is not the same, it only inverts colour lightness (so Less and javascript snippets of the first post do not match each other). "Invert lightness" can also be achieved with less verbose: spin((#fff - @color), 180);
Currently I'm using
color: hsl(hue(@black), saturation(@black), 100 - lightness(@black));
to invert colors but
color: invert(@color)
would be much better syntax for the job.
The code for function:
I tested it with less.js 1.2.1 so it works
The text was updated successfully, but these errors were encountered: