Skip to content

Commit

Permalink
Build color
Browse files Browse the repository at this point in the history
  • Loading branch information
apipkin committed Nov 6, 2012
1 parent 2efc6c2 commit f050939
Show file tree
Hide file tree
Showing 12 changed files with 428 additions and 371 deletions.
60 changes: 30 additions & 30 deletions build/color-base/color-base-coverage.js

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions build/color-base/color-base-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Color provides static methods for color conversion.
@submodule color-base
@class Base
@namespace Color
@since 3.x
@since 3.8.0
**/

var REGEX_HEX = /^#?([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})/,
Expand All @@ -27,7 +27,7 @@ Y.Color = {
@static
@property KEYWORDS
@type Object
@since 3.x
@since 3.8.0
**/
KEYWORDS: {
'black': '000', 'silver': 'c0c0c0', 'gray': '808080', 'white': 'fff',
Expand All @@ -41,7 +41,7 @@ Y.Color = {
@property REGEX_HEX
@type RegExp
@default /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/
@since 3.x
@since 3.8.0
**/
REGEX_HEX: REGEX_HEX,

Expand All @@ -50,7 +50,7 @@ Y.Color = {
@property REGEX_HEX3
@type RegExp
@default /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})/
@since 3.x
@since 3.8.0
**/
REGEX_HEX3: REGEX_HEX3,

Expand All @@ -59,7 +59,7 @@ Y.Color = {
@property REGEX_RGB
@type RegExp
@default /rgba?\(([0-9]{1,3}), ?([0-9]{1,3}), ?([0-9]{1,3}),? ?([.0-9]{1,3})?\)/
@since 3.x
@since 3.8.0
**/
REGEX_RGB: REGEX_RGB,

Expand All @@ -74,7 +74,7 @@ Y.Color = {
@property STR_HEX
@type String
@default #{*}{*}{*}
@since 3.x
@since 3.8.0
**/
STR_HEX: '#{*}{*}{*}',

Expand All @@ -83,7 +83,7 @@ Y.Color = {
@property STR_RGB
@type String
@default rgb({*}, {*}, {*})
@since 3.x
@since 3.8.0
**/
STR_RGB: 'rgb({*}, {*}, {*})',

Expand All @@ -92,7 +92,7 @@ Y.Color = {
@property STR_RGBA
@type String
@default rgba({*}, {*}, {*}, {*})
@since 3.x
@since 3.8.0
**/
STR_RGBA: 'rgba({*}, {*}, {*}, {*})',

Expand All @@ -101,7 +101,7 @@ Y.Color = {
@property TYPES
@type Object
@default {'rgb':'rgb', 'rgba':'rgba'}
@since 3.x
@since 3.8.0
**/
TYPES: TYPES,

Expand All @@ -110,7 +110,7 @@ Y.Color = {
@property CONVERTS
@type Object
@default {}
@since 3.x
@since 3.8.0
**/
CONVERTS: CONVERTS,

Expand All @@ -119,8 +119,8 @@ Y.Color = {
@method convert
@param {String} str
@param {String} to
@returns {String}
@since 3.x
@return {String}
@since 3.8.0
**/
convert: function (str, to) {
// check for a toXXX conversion method first
Expand All @@ -136,8 +136,8 @@ Y.Color = {
@public
@method toHex
@param {String} str Hex or RGB value string
@returns {String} returns array of values or CSS string if options.css is true
@since 3.x
@return {String} returns array of values or CSS string if options.css is true
@since 3.8.0
**/
toHex: function (str) {
var clr = Y.Color._convertTo(str, 'hex');
Expand All @@ -149,8 +149,8 @@ Y.Color = {
@public
@method toRGB
@param {String} str Hex or RGB value string
@returns {String}
@since 3.x
@return {String}
@since 3.8.0
**/
toRGB: function (str) {
var clr = Y.Color._convertTo(str, 'rgb');
Expand All @@ -162,8 +162,8 @@ Y.Color = {
@public
@method toRGBA
@param {String} str Hex or RGB value string
@returns {String}
@since 3.x
@return {String}
@since 3.8.0
**/
toRGBA: function (str) {
var clr = Y.Color._convertTo(str, 'rgba' );
Expand All @@ -177,8 +177,8 @@ Y.Color = {
@public
@method toArray
@param {String} str
@returns {Array}
@since 3.x
@return {Array}
@since 3.8.0
**/
toArray: function(str) {
// parse with regex and return "matches" array
Expand Down Expand Up @@ -216,8 +216,8 @@ Y.Color = {
@method fromArray
@param {Array} arr
@param {String} template
@returns {String}
@since 3.x
@return {String}
@since 3.8.0
**/
fromArray: function(arr, template) {
arr = arr.concat();
Expand Down Expand Up @@ -246,8 +246,8 @@ Y.Color = {
@public
@method findType
@param {String} str
@returns {String}
@since 3.x
@return {String}
@since 3.8.0
**/
findType: function (str) {
if (Y.Color.KEYWORDS[str]) {
Expand Down Expand Up @@ -276,7 +276,7 @@ Y.Color = {
@method _getAlpha
@param {String} clr
@return {Number}
@since 3.x
@since 3.8.0
**/
_getAlpha: function (clr) {
var alpha,
Expand All @@ -295,7 +295,7 @@ Y.Color = {
@method _keywordToHex
@param {String} clr
@return {String}
@since 3.x
@since 3.8.0
**/
_keywordToHex: function (clr) {
var keyword = Y.Color.KEYWORDS[clr];
Expand All @@ -312,7 +312,7 @@ Y.Color = {
@param {String} clr
@param {String} to
@return {String}
@since 3.x
@since 3.8.0
**/
_convertTo: function(clr, to) {
var from = Y.Color.findType(clr),
Expand Down Expand Up @@ -387,7 +387,7 @@ Y.Color = {
@param {String} str
@param {Boolean} [toArray]
@return {String|Array}
@since 3.x
@since 3.8.0
**/
_hexToRgb: function (str, toArray) {
var r, g, b;
Expand Down Expand Up @@ -418,7 +418,7 @@ Y.Color = {
@param {String} str
@param {Boolean} [toArray]
@return {String|Array}
@since 3.x
@since 3.8.0
**/
_rgbToHex: function (str) {
/*jshint bitwise:false*/
Expand Down
Loading

0 comments on commit f050939

Please sign in to comment.