COLOR

Verifies if the given string is a color representation

Options
  • hexboolean, true should we validate hex colors, including or excluding #
  • rgbboolean, true should we validate rgb colors, eg: rgb(0,0,0)
  • rgbaboolean, false should we validate rgba colors, eg: rgba(0,0,0,0.2)
'use strict';
thorin.validate('COLOR', 'inputString', {
   hex: true,
   rgb: true,
   rgba: false
});
Do you have a question or is something missing?

You can always create a new issue on GitHub or contact one of the core founders by chat.