specs
specs copied to clipboard
[css-color] multiplying by a percentage
hey tab, i'm mocking up a parser/converter for the color()
function, and was running into an issue of not knowing how to treat the multiplication by a percentage. the most natural way to multiply i'd assume would be by a integer/float
:
color(rgb(10, 10, 10) red(* 2))
but the spec says that multiplication happens with a percentage
only, so would that be the percentage of the current value? aka the above would translate to:
color(rgb(10, 10, 10) red(* 20%))
aka the 20%
is 2
of the red channel 10
. or would it be a percentage of the possible full channel, aka a percentage of 255
?
i could be way overthinking this. thanks for any help!