less.js
less.js copied to clipboard
Invalid color to function throws `color.toHSL is not a function`
See: https://github.com/mediafreakch/less-plugin-sass2less/issues/1#issuecomment-414817753 and #3338.
It looks like rather than throwing an error when an argument to a color function is not valid, some recent changes instead throw a color.toHSL conversion error, which confuses stylesheet authors. It seems it's still valid to throw an error, it's just the wrong error.
some recent changes instead throw a color.toHSL conversion error
It's been always like that, there're just one or two functions of all that really test if the input arg is a valid color and throw a friendly error.
@seven-phases-max oh? I was worried it was a knock-on bug from some changes to color functions I did for 3.5. Is it not worth looking into then?
I was worried it was a knock-on bug from some changes to color functions
Well, you just added a few more functions to the "unfriendly list" (previously all those functions of the rgba family did not accept colors at all). But, nothing new really.