Categories
Matches any hex color with #rgb, #rgba, #rrggbb, and #rrggbbaa formats.
Contributed by @itsbrunodev
^#(?:(?:[\da-f]{3}){1,2}|(?:[\da-f]{4}){1,2})$
# Valid Hex Colors #fff #fff5 #ffffff #ffffff50 # Invalid Hex Colors #f #ff #fffff