Jason Sebring Jason Sebring - 4 months ago 60
Less Question

How to invert colors in LESS

Is there a particular color operation I'm not seeing where you can invert colors? I'm seeing lots of color methods but could not see a way to do this.

reference:

http://lesscss.org/

Answer

There are multiple interpretation of inverting color.

  • You want a color with the opposite hue:

    spin(@color, 180)

  • You want a color that the sum with current one is white:

    #fff - @color