Skip to content

Instantly share code, notes, and snippets.

@rlemon
rlemon / colorConverter.js
Last active January 2, 2016 03:29
colorConverter function to convert hex to rgb
/* colorConverter
* takes hex input (3 or 6 char)
* and return the RGB value as an
* object.
* Does not account for shitty inputs
* #f000 will result in some funky RGB
*
* Note: '#' in the hex string is optional
*/
var colorConverter = function (h) {