Browse the docs

isColor

True when text is a colour.

Details #

isColor(value) is true when parseColor can read the text (hex, rgb(), hsl() or a CSS name). It never fails.

Parameters #

Takes 1 argument. {{ isColor(text) }}

Examples #

isColor("tomato")
→ true
isColor("#ff8000")
→ true

Gotchas #

  • Only text can be a colour.