Docs Home

sb.colors.toArray

@File: /surebert/colors/toArray.js

@Author: Paul Visco

@Description: Converts hex or rgb formatted color strings to an array


@Param: An rgb or hex color string
@Returns: Array An array of the r,g and b colors e.g. [255,255,255]
@Example:

var colorArray = sb.colors.toArray('#ffffff');
var colorArray = sb.colors.toArray('rbg(255,255,255)');

//both return [255,255,255]