Skip to content

Commit babea18

Browse files
committed
parse: properties: utils: Fix alpha handling for HSL and HWB
1 parent 178b1a4 commit babea18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parse/properties/utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ static bool parse_hsl(
710710
return false;
711711
}
712712

713-
if (token->type != CSS_TOKEN_NUMBER) {
713+
if (token->type == CSS_TOKEN_NUMBER) {
714714
alpha = FIXTOINT(FMUL(alpha, F_255));
715715
} else {
716716
alpha = FIXTOINT(FDIV(FMUL(alpha, F_255), F_100));
@@ -890,7 +890,7 @@ static bool parse_hwb(
890890
return false;
891891
}
892892

893-
if (token->type != CSS_TOKEN_NUMBER) {
893+
if (token->type == CSS_TOKEN_NUMBER) {
894894
alpha = FIXTOINT(FMUL(alpha, F_255));
895895
} else {
896896
alpha = FIXTOINT(FDIV(FMUL(alpha, F_255), F_100));

0 commit comments

Comments
 (0)