cloudhead/less.js — Issue #531: coloralpha
Author: yukulele
Created: 2011-12-19 11:20:56+00:00
State: open

hi,
I suggest a 'coloralpha' function to add alpha channel to color :

LESS :

body
{
background-color : coloralpha(#ffcc00 , 0.5);
color : coloralpha(blue , 0.3);
}

CSS :

body
{
background : rgba(255 , 204 , 0 , 0.5);
color : rgba(0 , 0 , 255 , 0.3
}

actualy I need to do this ugly workaround :

body
{
@col:#ffcc00
background : hsla(hue(@col) , saturation(@col) , lightness(@col) , 0.5);
color : hsla(hue(red) , saturation(red) , lightness(red) , 0.5);
}