All files / internalHelpers _isValidColor.js

100% Statements 10/10
100% Branches 0/0
100% Functions 5/5
100% Lines 5/5
1 2 3 4 5 6 7  3x 3x 3x 3x 3x  
// @flow
export const isRgb = (color: string) : bool => /rgb\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)/.test(color)
export const isRgba = (color: string) : bool => /rgba\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3}), ?(\d{1})?.?(\d{1,2})\)/.test(color)
export const isHsl = (color: string) : bool => /hsl\((\d{1,3}), ?(\d{1,3})%, ?(\d{1,3})%\)/.test(color)
export const isHsla = (color: string) : bool => /hsla\((\d{1,3}), ?(\d{1,3})%, ?(\d{1,3})%, ?(\d{1})?.?(\d{1,2})\)/.test(color)
export const isHex = (color: string) : bool => /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(color)