Skip to content

Commit 4872aab

Browse files
committed
make 6 a valid length for hex colors
Also marks `isHexColor` as public function.
1 parent 0a705b1 commit 4872aab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/browser/cssom/CSSStyleDeclaration.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ fn isNumericWithUnit(value: []const u8) bool {
190190
return CSSKeywords.isValidUnit(unit);
191191
}
192192

193-
fn isHexColor(value: []const u8) bool {
193+
pub fn isHexColor(value: []const u8) bool {
194194
if (value.len == 0) {
195195
return false;
196196
}
@@ -199,7 +199,7 @@ fn isHexColor(value: []const u8) bool {
199199
}
200200

201201
const hex_part = value[1..];
202-
if (hex_part.len != 3 and hex_part.len != 6 and hex_part.len != 8) {
202+
if (hex_part.len != 3 and hex_part.len != 4 and hex_part.len != 6 and hex_part.len != 8) {
203203
return false;
204204
}
205205

0 commit comments

Comments
 (0)