Less Contrast resulting CSS issue

by Timo Breumelhof   Last Updated January 11, 2019 11:26 AM

It might be I don't understand the Less contrast function correctly but I don't seem to get the results I would expect. I am trying to get a contrasting color for buttons on a (dark) colored background.

I did some testing and what it comes down to is this:

a{
 &.a{
        color: contrast(#222222, #111111, #555555);
    }
        &.b{
        color: contrast(#333333, #111111, #555555);
    }
        &.c{
        color: contrast(#444444, #111111, #555555);
    }
        &.d{
        color: contrast(#555555, #111111, #555555);
    }
            &.e{
        color: contrast(#666666, #111111, #555555);
    }
}

I would expect the contrast function to switch from #111 to #555 somewhere, but I always get #555 as a result.

Codepen: [https://codepen.io/Timo88/pen/Xoxyez][1]

Tags : css less contrast


Related Questions


Updated November 04, 2017 17:26 PM

Updated April 28, 2018 01:26 AM

Updated September 09, 2017 23:26 PM