MCPcopy Index your code
hub / github.com/darkreader/darkreader / isValidHexColor

Function isValidHexColor

src/utils/colorscheme-parser.ts:35–37  ·  view source on GitHub ↗
(color: string)

Source from the content-addressed store, hash-verified

33
34// Should return if the given string is a valid 3 or 6 digit hex color.
35const isValidHexColor = (color: string): boolean => {
36 return /^#([0-9a-fA-F]{3}){1,2}$/.test(color);
37};
38
39interface ColorSchemeVariant {
40 // The background color of the color scheme in hex format.

Callers 1

checkVariantFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected