Skip to content

Instantly share code, notes, and snippets.

@alexko30
Created August 14, 2018 23:14
Show Gist options
  • Save alexko30/54d8e7ba75a3d3ee4b4179ab2bd032ab to your computer and use it in GitHub Desktop.
Save alexko30/54d8e7ba75a3d3ee4b4179ab2bd032ab to your computer and use it in GitHub Desktop.
test(startValue) { // rgb(255, 0, 0)
return startValue.indexOf('rgb') >= 0
|| startValue.indexOf('#') >= 0
|| startValue.indexOf('hsl') >= 0
|| (typeof startValue === 'string' && colorString.get.rgb(startValue)); // true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment