Skip to content

Commit 9ed3c36

Browse files
committed
chore: clean up comments for clarity
1 parent 115813e commit 9ed3c36

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

site/src/utils/colors.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
/**
2-
* Does not support shorthand hex string (e.g., #fff)
2+
* Does not support shorthand hex strings (e.g., #fff), just to maximize
3+
* compatibility with server, which also doesn't support shorthand
34
*/
45
const hexMatcher = /^#[0-9A-Fa-f]{6}$/;
56

7+
/**
8+
* Determines whether a string is a hex color string. Returns false for
9+
* shorthand hex strings.
10+
*
11+
* Mainly here to validate input before sending it to the server.
12+
*/
613
export function isHexColor(input: string): boolean {
714
return hexMatcher.test(input);
815
}

0 commit comments

Comments
 (0)