I'm trying to write a block in the CSS preprocessor LESS that will do the following:
@transparent_background(@color; @alpha: .8)
{
background: @color;
background: rgba(<color R value>, <color G value>, <color B value>, @alpha);
}
Is there any way to get the RGB values out of @color if it's a standard hex definition (i.e. #rrggbb)? Is there a way to do this if @color is defined some other way?
EDIT: SOLUTION
@transparent_background(@color; @alpha: .8)
{
background: @color;
background: @color + rgba(0, 0, 0, @alpha);
}