mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-16 00:08:59 +00:00
make 6 a valid length for hex colors
Also marks `isHexColor` as public function.
This commit is contained in:
@@ -190,7 +190,7 @@ fn isNumericWithUnit(value: []const u8) bool {
|
|||||||
return CSSKeywords.isValidUnit(unit);
|
return CSSKeywords.isValidUnit(unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn isHexColor(value: []const u8) bool {
|
pub fn isHexColor(value: []const u8) bool {
|
||||||
if (value.len == 0) {
|
if (value.len == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -199,7 +199,7 @@ fn isHexColor(value: []const u8) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const hex_part = value[1..];
|
const hex_part = value[1..];
|
||||||
if (hex_part.len != 3 and hex_part.len != 6 and hex_part.len != 8) {
|
if (hex_part.len != 3 and hex_part.len != 4 and hex_part.len != 6 and hex_part.len != 8) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user