Convert rgba colour definition string in LESS to color instance
问题 Suppose I've parsed my mixin parameters and colours are provided using rgba function. Now I would like to mix two of those colours, but LESS mix function requires parameter instances of type color . What I tried ...and doesn't work calling color("rgba(0,0,0,.5)") mix(@first, ~"@{second}") where @second is a string like rgba(0,0,0,0.5) How do I convert to color? 回答1: I'm afraid you won't find a built in function to do this in LESS. The color() functions argument needs to be a hexadecimal or