Core Docs | Additional Modules Docs

sb.colors.dec2hex


@Description: coverts decimal values to hex
@File: colors/dec2hex.js
@Example:
var hex = sb.colors.dec2hex(255);

sb.colors.getTweenColor


@Description: Used to get color values between two colors at a certain percentage
@File: colors/getTweenColor.js
@Author: Paul Visco
@Version: 1.1 11/19/07 11/16/08
@Example:
var colorInBetween = sb.colors.getTweenColor('#ACACAC', '#FF0000', 30%);

sb.colors.hex2dec


@Description: coverts hex values to decimal
@File: colors/hex2dec.js
@Example:
var hex = sb.colors.hex2dec('AC');

sb.colors.html


@Description: A lookup table for HTML color name to hex color value. Allows for html color values to rgb value conversion when using sb.css method in IE
@File: colors/html.js
@Author: Paul Visco
@Example:
var hexColor = sb.colors.html.aliceblue;
hexColor = #f0f8ff

sb.colors.rand


@Description: Returns a random color string that can be used to set an elements style properties
@File: colors/rand.js
@Author: Paul Visco
@Version: 1.0 11/19/07
@Param: Boolean grey If set to one, it returns only greyscale colors meaning r,g, and b values are the same
@Return: Array An rgb color string rgb(234,34,156);
@Example:
var colorArray = sb.colors.rand();
colorArray = rgb(234,34,156);//<-one possible return value

var colorArray = sb.colors.rand(1);
colorArray = rgb(34,34,34);//<-one possible return value
//both return [255,255,255]

sb.colors.toArray


@Description: Converts hex or rgb formatted color strings to an array
@File: colors/toArray.js
@Author: Paul Visco
@Param: An rgb or hex color string
@Return: 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]