Skip to content

Commit 8f73078

Browse files
authored
fix: allow 3-char hex colors #13
1 parent 58d695f commit 8f73078

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function isValidGitHubUsername(username: string): boolean {
3737

3838
/** Validates hex color format (with or without #) */
3939
function isValidHexColor(color: string): boolean {
40-
return /^#?[0-9a-fA-F]{6}$/.test(color);
40+
return /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(color);
4141
}
4242

4343
/* --- Routes --- */

0 commit comments

Comments
 (0)