Low-level hex-colour predicate — the single regex source for the codebase.
⚠️ The two callers deliberately disagree on shorthand #RGB, and that is preserved.
Profile style JSON (style-validator-helpers.ts) requires the full #RRGGBB and says
so in its error message; GeoJSON feature properties (geojson/feature-validator.ts)
accept both and say so in theirs. Collapsing them into one predicate would silently
either loosen the style contract or reject feature data that validates today — so the
option is explicit rather than the divergence being re-implemented twice (S5 backlog B.2).
Distinct from validateColor() below, which also accepts rgb()/rgba() and defers to
CSS.supports — a much wider surface, and public API.
Low-level hex-colour predicate — the single regex source for the codebase.
⚠️ The two callers deliberately disagree on shorthand
#RGB, and that is preserved. Profile style JSON (style-validator-helpers.ts) requires the full#RRGGBBand says so in its error message; GeoJSON feature properties (geojson/feature-validator.ts) accept both and say so in theirs. Collapsing them into one predicate would silently either loosen the style contract or reject feature data that validates today — so the option is explicit rather than the divergence being re-implemented twice (S5 backlog B.2).Distinct from
validateColor()below, which also acceptsrgb()/rgba()and defers toCSS.supports— a much wider surface, and public API.