10 __coverage__['build/color-base/color-base.js'] = {"path":"build/color-base/color-base.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":41}}},"2":{"name":"(anonymous_2)","line":135,"loc":{"start":{"line":135,"column":13},"end":{"line":135,"column":32}}},"3":{"name":"(anonymous_3)","line":155,"loc":{"start":{"line":155,"column":11},"end":{"line":155,"column":26}}},"4":{"name":"(anonymous_4)","line":174,"loc":{"start":{"line":174,"column":11},"end":{"line":174,"column":26}}},"5":{"name":"(anonymous_5)","line":187,"loc":{"start":{"line":187,"column":12},"end":{"line":187,"column":27}}},"6":{"name":"(anonymous_6)","line":213,"loc":{"start":{"line":213,"column":13},"end":{"line":213,"column":27}}},"7":{"name":"(anonymous_7)","line":266,"loc":{"start":{"line":266,"column":15},"end":{"line":266,"column":39}}},"8":{"name":"(anonymous_8)","line":296,"loc":{"start":{"line":296,"column":14},"end":{"line":296,"column":29}}},"9":{"name":"(anonymous_9)","line":325,"loc":{"start":{"line":325,"column":15},"end":{"line":325,"column":30}}},"10":{"name":"(anonymous_10)","line":344,"loc":{"start":{"line":344,"column":19},"end":{"line":344,"column":34}}},"11":{"name":"(anonymous_11)","line":361,"loc":{"start":{"line":361,"column":16},"end":{"line":361,"column":34}}},"12":{"name":"(anonymous_12)","line":443,"loc":{"start":{"line":443,"column":15},"end":{"line":443,"column":39}}},"13":{"name":"(anonymous_13)","line":474,"loc":{"start":{"line":474,"column":15},"end":{"line":474,"column":30}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":492,"column":41}},"2":{"start":{"line":16,"column":0},"end":{"line":20,"column":68}},"3":{"start":{"line":23,"column":0},"end":{"line":488,"column":2}},"4":{"start":{"line":136,"column":8},"end":{"line":137,"column":22}},"5":{"start":{"line":139,"column":8},"end":{"line":141,"column":9}},"6":{"start":{"line":140,"column":12},"end":{"line":140,"column":40}},"7":{"start":{"line":143,"column":8},"end":{"line":143,"column":19}},"8":{"start":{"line":156,"column":8},"end":{"line":157,"column":64}},"9":{"start":{"line":159,"column":8},"end":{"line":161,"column":9}},"10":{"start":{"line":160,"column":12},"end":{"line":160,"column":28}},"11":{"start":{"line":163,"column":8},"end":{"line":163,"column":69}},"12":{"start":{"line":175,"column":8},"end":{"line":175,"column":49}},"13":{"start":{"line":176,"column":8},"end":{"line":176,"column":33}},"14":{"start":{"line":188,"column":8},"end":{"line":188,"column":51}},"15":{"start":{"line":189,"column":8},"end":{"line":189,"column":33}},"16":{"start":{"line":215,"column":8},"end":{"line":219,"column":21}},"17":{"start":{"line":221,"column":8},"end":{"line":223,"column":9}},"18":{"start":{"line":222,"column":12},"end":{"line":222,"column":26}},"19":{"start":{"line":225,"column":8},"end":{"line":227,"column":9}},"20":{"start":{"line":226,"column":12},"end":{"line":226,"column":37}},"21":{"start":{"line":229,"column":8},"end":{"line":229,"column":41}},"22":{"start":{"line":231,"column":8},"end":{"line":251,"column":9}},"23":{"start":{"line":232,"column":12},"end":{"line":232,"column":40}},"24":{"start":{"line":233,"column":12},"end":{"line":233,"column":32}},"25":{"start":{"line":235,"column":12},"end":{"line":250,"column":13}},"26":{"start":{"line":237,"column":16},"end":{"line":237,"column":28}},"27":{"start":{"line":238,"column":16},"end":{"line":238,"column":25}},"28":{"start":{"line":240,"column":16},"end":{"line":244,"column":17}},"29":{"start":{"line":241,"column":20},"end":{"line":241,"column":37}},"30":{"start":{"line":242,"column":20},"end":{"line":242,"column":37}},"31":{"start":{"line":243,"column":20},"end":{"line":243,"column":37}},"32":{"start":{"line":246,"column":16},"end":{"line":246,"column":43}},"33":{"start":{"line":247,"column":16},"end":{"line":249,"column":17}},"34":{"start":{"line":248,"column":20},"end":{"line":248,"column":40}},"35":{"start":{"line":253,"column":8},"end":{"line":253,"column":19}},"36":{"start":{"line":267,"column":8},"end":{"line":267,"column":27}},"37":{"start":{"line":269,"column":8},"end":{"line":271,"column":9}},"38":{"start":{"line":270,"column":12},"end":{"line":270,"column":34}},"39":{"start":{"line":273,"column":8},"end":{"line":273,"column":28}},"40":{"start":{"line":275,"column":8},"end":{"line":275,"column":60}},"41":{"start":{"line":277,"column":8},"end":{"line":279,"column":9}},"42":{"start":{"line":278,"column":12},"end":{"line":278,"column":24}},"43":{"start":{"line":281,"column":8},"end":{"line":283,"column":9}},"44":{"start":{"line":282,"column":12},"end":{"line":282,"column":62}},"45":{"start":{"line":285,"column":8},"end":{"line":285,"column":24}},"46":{"start":{"line":297,"column":8},"end":{"line":299,"column":9}},"47":{"start":{"line":298,"column":12},"end":{"line":298,"column":29}},"48":{"start":{"line":301,"column":8},"end":{"line":302,"column":16}},"49":{"start":{"line":304,"column":8},"end":{"line":306,"column":9}},"50":{"start":{"line":305,"column":12},"end":{"line":305,"column":39}},"51":{"start":{"line":308,"column":8},"end":{"line":310,"column":9}},"52":{"start":{"line":309,"column":12},"end":{"line":309,"column":52}},"53":{"start":{"line":312,"column":8},"end":{"line":312,"column":21}},"54":{"start":{"line":326,"column":8},"end":{"line":327,"column":39}},"55":{"start":{"line":329,"column":8},"end":{"line":331,"column":9}},"56":{"start":{"line":330,"column":12},"end":{"line":330,"column":30}},"57":{"start":{"line":333,"column":8},"end":{"line":333,"column":27}},"58":{"start":{"line":345,"column":8},"end":{"line":345,"column":44}},"59":{"start":{"line":347,"column":8},"end":{"line":349,"column":9}},"60":{"start":{"line":348,"column":12},"end":{"line":348,"column":27}},"61":{"start":{"line":363,"column":8},"end":{"line":365,"column":9}},"62":{"start":{"line":364,"column":12},"end":{"line":364,"column":23}},"63":{"start":{"line":367,"column":8},"end":{"line":372,"column":17}},"64":{"start":{"line":374,"column":8},"end":{"line":377,"column":9}},"65":{"start":{"line":375,"column":12},"end":{"line":375,"column":45}},"66":{"start":{"line":376,"column":12},"end":{"line":376,"column":25}},"67":{"start":{"line":379,"column":8},"end":{"line":387,"column":9}},"68":{"start":{"line":380,"column":12},"end":{"line":382,"column":13}},"69":{"start":{"line":381,"column":16},"end":{"line":381,"column":36}},"70":{"start":{"line":384,"column":12},"end":{"line":386,"column":54}},"71":{"start":{"line":389,"column":8},"end":{"line":391,"column":9}},"72":{"start":{"line":390,"column":12},"end":{"line":390,"column":23}},"73":{"start":{"line":393,"column":8},"end":{"line":395,"column":9}},"74":{"start":{"line":394,"column":12},"end":{"line":394,"column":37}},"75":{"start":{"line":397,"column":8},"end":{"line":397,"column":56}},"76":{"start":{"line":398,"column":8},"end":{"line":401,"column":9}},"77":{"start":{"line":399,"column":12},"end":{"line":399,"column":33}},"78":{"start":{"line":400,"column":12},"end":{"line":400,"column":43}},"79":{"start":{"line":403,"column":8},"end":{"line":403,"column":71}},"80":{"start":{"line":404,"column":8},"end":{"line":404,"column":52}},"81":{"start":{"line":409,"column":8},"end":{"line":415,"column":9}},"82":{"start":{"line":410,"column":12},"end":{"line":414,"column":13}},"83":{"start":{"line":411,"column":16},"end":{"line":411,"column":57}},"84":{"start":{"line":412,"column":16},"end":{"line":412,"column":29}},"85":{"start":{"line":413,"column":16},"end":{"line":413,"column":60}},"86":{"start":{"line":417,"column":8},"end":{"line":419,"column":9}},"87":{"start":{"line":418,"column":12},"end":{"line":418,"column":46}},"88":{"start":{"line":422,"column":8},"end":{"line":428,"column":9}},"89":{"start":{"line":423,"column":12},"end":{"line":425,"column":13}},"90":{"start":{"line":424,"column":16},"end":{"line":424,"column":43}},"91":{"start":{"line":426,"column":12},"end":{"line":426,"column":28}},"92":{"start":{"line":427,"column":12},"end":{"line":427,"column":67}},"93":{"start":{"line":430,"column":8},"end":{"line":430,"column":19}},"94":{"start":{"line":444,"column":8},"end":{"line":444,"column":20}},"95":{"start":{"line":447,"column":8},"end":{"line":449,"column":9}},"96":{"start":{"line":448,"column":12},"end":{"line":448,"column":32}},"97":{"start":{"line":451,"column":8},"end":{"line":451,"column":32}},"98":{"start":{"line":453,"column":8},"end":{"line":453,"column":22}},"99":{"start":{"line":454,"column":8},"end":{"line":454,"column":28}},"100":{"start":{"line":455,"column":8},"end":{"line":455,"column":23}},"101":{"start":{"line":457,"column":8},"end":{"line":459,"column":9}},"102":{"start":{"line":458,"column":12},"end":{"line":458,"column":29}},"103":{"start":{"line":461,"column":8},"end":{"line":461,"column":54}},"104":{"start":{"line":476,"column":8},"end":{"line":477,"column":58}},"105":{"start":{"line":479,"column":8},"end":{"line":479,"column":34}},"106":{"start":{"line":481,"column":8},"end":{"line":483,"column":9}},"107":{"start":{"line":482,"column":12},"end":{"line":482,"column":28}},"108":{"start":{"line":485,"column":8},"end":{"line":485,"column":25}}},"branchMap":{"1":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":139,"column":8}},{"start":{"line":139,"column":8},"end":{"line":139,"column":8}}]},"2":{"line":139,"type":"binary-expr","locations":[{"start":{"line":139,"column":12},"end":{"line":139,"column":19}},{"start":{"line":139,"column":23},"end":{"line":139,"column":39}}]},"3":{"line":159,"type":"if","locations":[{"start":{"line":159,"column":8},"end":{"line":159,"column":8}},{"start":{"line":159,"column":8},"end":{"line":159,"column":8}}]},"4":{"line":159,"type":"binary-expr","locations":[{"start":{"line":159,"column":12},"end":{"line":159,"column":33}},{"start":{"line":159,"column":37},"end":{"line":159,"column":51}}]},"5":{"line":163,"type":"cond-expr","locations":[{"start":{"line":163,"column":31},"end":{"line":163,"column":48}},{"start":{"line":163,"column":51},"end":{"line":163,"column":68}}]},"6":{"line":221,"type":"if","locations":[{"start":{"line":221,"column":8},"end":{"line":221,"column":8}},{"start":{"line":221,"column":8},"end":{"line":221,"column":8}}]},"7":{"line":221,"type":"binary-expr","locations":[{"start":{"line":221,"column":12},"end":{"line":221,"column":26}},{"start":{"line":221,"column":30},"end":{"line":221,"column":44}}]},"8":{"line":225,"type":"if","locations":[{"start":{"line":225,"column":8},"end":{"line":225,"column":8}},{"start":{"line":225,"column":8},"end":{"line":225,"column":8}}]},"9":{"line":231,"type":"if","locations":[{"start":{"line":231,"column":8},"end":{"line":231,"column":8}},{"start":{"line":231,"column":8},"end":{"line":231,"column":8}}]},"10":{"line":232,"type":"binary-expr","locations":[{"start":{"line":232,"column":18},"end":{"line":232,"column":33}},{"start":{"line":232,"column":37},"end":{"line":232,"column":39}}]},"11":{"line":235,"type":"if","locations":[{"start":{"line":235,"column":12},"end":{"line":235,"column":12}},{"start":{"line":235,"column":12},"end":{"line":235,"column":12}}]},"12":{"line":240,"type":"if","locations":[{"start":{"line":240,"column":16},"end":{"line":240,"column":16}},{"start":{"line":240,"column":16},"end":{"line":240,"column":16}}]},"13":{"line":247,"type":"if","locations":[{"start":{"line":247,"column":16},"end":{"line":247,"column":16}},{"start":{"line":247,"column":16},"end":{"line":247,"column":16}}]},"14":{"line":269,"type":"if","locations":[{"start":{"line":269,"column":8},"end":{"line":269,"column":8}},{"start":{"line":269,"column":8},"end":{"line":269,"column":8}}]},"15":{"line":277,"type":"if","locations":[{"start":{"line":277,"column":8},"end":{"line":277,"column":8}},{"start":{"line":277,"column":8},"end":{"line":277,"column":8}}]},"16":{"line":277,"type":"binary-expr","locations":[{"start":{"line":277,"column":12},"end":{"line":277,"column":28}},{"start":{"line":277,"column":32},"end":{"line":277,"column":70}}]},"17":{"line":281,"type":"binary-expr","locations":[{"start":{"line":281,"column":16},"end":{"line":281,"column":46}},{"start":{"line":281,"column":50},"end":{"line":281,"column":64}}]},"18":{"line":297,"type":"if","locations":[{"start":{"line":297,"column":8},"end":{"line":297,"column":8}},{"start":{"line":297,"column":8},"end":{"line":297,"column":8}}]},"19":{"line":304,"type":"if","locations":[{"start":{"line":304,"column":8},"end":{"line":304,"column":8}},{"start":{"line":304,"column":8},"end":{"line":304,"column":8}}]},"20":{"line":308,"type":"if","locations":[{"start":{"line":308,"column":8},"end":{"line":308,"column":8}},{"start":{"line":308,"column":8},"end":{"line":308,"column":8}}]},"21":{"line":308,"type":"binary-expr","locations":[{"start":{"line":308,"column":12},"end":{"line":308,"column":15}},{"start":{"line":308,"column":19},"end":{"line":308,"column":51}}]},"22":{"line":329,"type":"if","locations":[{"start":{"line":329,"column":8},"end":{"line":329,"column":8}},{"start":{"line":329,"column":8},"end":{"line":329,"column":8}}]},"23":{"line":333,"type":"binary-expr","locations":[{"start":{"line":333,"column":15},"end":{"line":333,"column":21}},{"start":{"line":333,"column":25},"end":{"line":333,"column":26}}]},"24":{"line":347,"type":"if","locations":[{"start":{"line":347,"column":8},"end":{"line":347,"column":8}},{"start":{"line":347,"column":8},"end":{"line":347,"column":8}}]},"25":{"line":363,"type":"if","locations":[{"start":{"line":363,"column":8},"end":{"line":363,"column":8}},{"start":{"line":363,"column":8},"end":{"line":363,"column":8}}]},"26":{"line":374,"type":"if","locations":[{"start":{"line":374,"column":8},"end":{"line":374,"column":8}},{"start":{"line":374,"column":8},"end":{"line":374,"column":8}}]},"27":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":8},"end":{"line":379,"column":8}},{"start":{"line":379,"column":8},"end":{"line":379,"column":8}}]},"28":{"line":379,"type":"binary-expr","locations":[{"start":{"line":379,"column":12},"end":{"line":379,"column":26}},{"start":{"line":379,"column":30},"end":{"line":379,"column":44}}]},"29":{"line":380,"type":"if","locations":[{"start":{"line":380,"column":12},"end":{"line":380,"column":12}},{"start":{"line":380,"column":12},"end":{"line":380,"column":12}}]},"30":{"line":389,"type":"if","locations":[{"start":{"line":389,"column":8},"end":{"line":389,"column":8}},{"start":{"line":389,"column":8},"end":{"line":389,"column":8}}]},"31":{"line":393,"type":"if","locations":[{"start":{"line":393,"column":8},"end":{"line":393,"column":8}},{"start":{"line":393,"column":8},"end":{"line":393,"column":8}}]},"32":{"line":398,"type":"if","locations":[{"start":{"line":398,"column":8},"end":{"line":398,"column":8}},{"start":{"line":398,"column":8},"end":{"line":398,"column":8}}]},"33":{"line":409,"type":"if","locations":[{"start":{"line":409,"column":8},"end":{"line":409,"column":8}},{"start":{"line":409,"column":8},"end":{"line":409,"column":8}}]},"34":{"line":410,"type":"if","locations":[{"start":{"line":410,"column":12},"end":{"line":410,"column":12}},{"start":{"line":410,"column":12},"end":{"line":410,"column":12}}]},"35":{"line":410,"type":"binary-expr","locations":[{"start":{"line":410,"column":16},"end":{"line":410,"column":30}},{"start":{"line":410,"column":34},"end":{"line":410,"column":46}}]},"36":{"line":417,"type":"if","locations":[{"start":{"line":417,"column":8},"end":{"line":417,"column":8}},{"start":{"line":417,"column":8},"end":{"line":417,"column":8}}]},"37":{"line":422,"type":"if","locations":[{"start":{"line":422,"column":8},"end":{"line":422,"column":8}},{"start":{"line":422,"column":8},"end":{"line":422,"column":8}}]},"38":{"line":423,"type":"if","locations":[{"start":{"line":423,"column":12},"end":{"line":423,"column":12}},{"start":{"line":423,"column":12},"end":{"line":423,"column":12}}]},"39":{"line":447,"type":"if","locations":[{"start":{"line":447,"column":8},"end":{"line":447,"column":8}},{"start":{"line":447,"column":8},"end":{"line":447,"column":8}}]},"40":{"line":457,"type":"if","locations":[{"start":{"line":457,"column":8},"end":{"line":457,"column":8}},{"start":{"line":457,"column":8},"end":{"line":457,"column":8}}]}},"code":["(function () { YUI.add('color-base', function (Y, NAME) {","","/**","Color provides static methods for color conversion.",""," Y.Color.toRGB('f00'); // rgb(255, 0, 0)",""," Y.Color.toHex('rgb(255, 255, 0)'); // #ffff00","","@module color","@submodule color-base","@class Color","@since 3.8.0","**/","","var REGEX_HEX = /^#?([\\da-fA-F]{2})([\\da-fA-F]{2})([\\da-fA-F]{2})(\\ufffe)?/,"," REGEX_HEX3 = /^#?([\\da-fA-F]{1})([\\da-fA-F]{1})([\\da-fA-F]{1})(\\ufffe)?/,"," REGEX_RGB = /rgba?\\(([\\d]{1,3}), ?([\\d]{1,3}), ?([\\d]{1,3}),? ?([.\\d]*)?\\)/,"," TYPES = { 'HEX': 'hex', 'RGB': 'rgb', 'RGBA': 'rgba' },"," CONVERTS = { 'hex': 'toHex', 'rgb': 'toRGB', 'rgba': 'toRGBA' };","","","Y.Color = {"," /**"," @static"," @property KEYWORDS"," @type Object"," @since 3.8.0"," **/"," KEYWORDS: {"," 'black': '000', 'silver': 'c0c0c0', 'gray': '808080', 'white': 'fff',"," 'maroon': '800000', 'red': 'f00', 'purple': '800080', 'fuchsia': 'f0f',"," 'green': '008000', 'lime': '0f0', 'olive': '808000', 'yellow': 'ff0',"," 'navy': '000080', 'blue': '00f', 'teal': '008080', 'aqua': '0ff'"," },",""," /**"," NOTE: `(\\ufffe)?` is added to the Regular Expression to carve out a"," place for the alpha channel that is returned from toArray"," without compromising any usage of the Regular Expression",""," @static"," @property REGEX_HEX"," @type RegExp"," @default /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})(\\ufffe)?/"," @since 3.8.0"," **/"," REGEX_HEX: REGEX_HEX,",""," /**"," NOTE: `(\\ufffe)?` is added to the Regular Expression to carve out a"," place for the alpha channel that is returned from toArray"," without compromising any usage of the Regular Expression",""," @static"," @property REGEX_HEX3"," @type RegExp"," @default /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})(\\ufffe)?/"," @since 3.8.0"," **/"," REGEX_HEX3: REGEX_HEX3,",""," /**"," @static"," @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.8.0"," **/"," REGEX_RGB: REGEX_RGB,",""," re_RGB: REGEX_RGB,",""," re_hex: REGEX_HEX,",""," re_hex3: REGEX_HEX3,",""," /**"," @static"," @property STR_HEX"," @type String"," @default #{*}{*}{*}"," @since 3.8.0"," **/"," STR_HEX: '#{*}{*}{*}',",""," /**"," @static"," @property STR_RGB"," @type String"," @default rgb({*}, {*}, {*})"," @since 3.8.0"," **/"," STR_RGB: 'rgb({*}, {*}, {*})',",""," /**"," @static"," @property STR_RGBA"," @type String"," @default rgba({*}, {*}, {*}, {*})"," @since 3.8.0"," **/"," STR_RGBA: 'rgba({*}, {*}, {*}, {*})',",""," /**"," @static"," @property TYPES"," @type Object"," @default {'rgb':'rgb', 'rgba':'rgba'}"," @since 3.8.0"," **/"," TYPES: TYPES,",""," /**"," @static"," @property CONVERTS"," @type Object"," @default {}"," @since 3.8.0"," **/"," CONVERTS: CONVERTS,",""," /**"," Converts the provided string to the provided type."," You can use the `Y.Color.TYPES` to get a valid `to` type."," If the color cannot be converted, the original color will be returned.",""," @public"," @method convert"," @param {String} str"," @param {String} to"," @return {String}"," @since 3.8.0"," **/"," convert: function (str, to) {"," var convert = Y.Color.CONVERTS[to.toLowerCase()],"," clr = str;",""," if (convert && Y.Color[convert]) {"," clr = Y.Color[convert](str);"," }",""," return clr;"," },",""," /**"," Converts provided color value to a hex value string",""," @public"," @method toHex"," @param {String} str Hex or RGB value string"," @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'),"," isTransparent = clr.toLowerCase() === 'transparent';",""," if (clr.charAt(0) !== '#' && !isTransparent) {"," clr = '#' + clr;"," }",""," return isTransparent ? clr.toLowerCase() : clr.toUpperCase();"," },",""," /**"," Converts provided color value to an RGB value string"," @public"," @method toRGB"," @param {String} str Hex or RGB value string"," @return {String}"," @since 3.8.0"," **/"," toRGB: function (str) {"," var clr = Y.Color._convertTo(str, 'rgb');"," return clr.toLowerCase();"," },",""," /**"," Converts provided color value to an RGB value string"," @public"," @method toRGBA"," @param {String} str Hex or RGB value string"," @return {String}"," @since 3.8.0"," **/"," toRGBA: function (str) {"," var clr = Y.Color._convertTo(str, 'rgba' );"," return clr.toLowerCase();"," },",""," /**"," Converts the provided color string to an array of values where the"," last value is the alpha value. Will return an empty array if"," the provided string is not able to be parsed.",""," NOTE: `(\\ufffe)?` is added to `HEX` and `HEX3` Regular Expressions to"," carve out a place for the alpha channel that is returned from"," toArray without compromising any usage of the Regular Expression",""," Y.Color.toArray('fff'); // ['ff', 'ff', 'ff', 1]"," Y.Color.toArray('rgb(0, 0, 0)'); // ['0', '0', '0', 1]"," Y.Color.toArray('rgba(0, 0, 0, 0)'); // ['0', '0', '0', 1]","","",""," @public"," @method toArray"," @param {String} str"," @return {Array}"," @since 3.8.0"," **/"," toArray: function(str) {"," // parse with regex and return \"matches\" array"," var type = Y.Color.findType(str).toUpperCase(),"," regex,"," arr,"," length,"," lastItem;",""," if (type === 'HEX' && str.length < 5) {"," type = 'HEX3';"," }",""," if (type.charAt(type.length - 1) === 'A') {"," type = type.slice(0, -1);"," }",""," regex = Y.Color['REGEX_' + type];",""," if (regex) {"," arr = regex.exec(str) || [];"," length = arr.length;",""," if (length) {",""," arr.shift();"," length--;",""," if (type === 'HEX3') {"," arr[0] += arr[0];"," arr[1] += arr[1];"," arr[2] += arr[2];"," }",""," lastItem = arr[length - 1];"," if (!lastItem) {"," arr[length - 1] = 1;"," }"," }"," }",""," return arr;",""," },",""," /**"," Converts the array of values to a string based on the provided template."," @public"," @method fromArray"," @param {Array} arr"," @param {String} template"," @return {String}"," @since 3.8.0"," **/"," fromArray: function(arr, template) {"," arr = arr.concat();",""," if (typeof template === 'undefined') {"," return arr.join(', ');"," }",""," var replace = '{*}';",""," template = Y.Color['STR_' + template.toUpperCase()];",""," if (arr.length === 3 && template.match(/\\{\\*\\}/g).length === 4) {"," arr.push(1);"," }",""," while ( template.indexOf(replace) >= 0 && arr.length > 0) {"," template = template.replace(replace, arr.shift());"," }",""," return template;"," },",""," /**"," Finds the value type based on the str value provided."," @public"," @method findType"," @param {String} str"," @return {String}"," @since 3.8.0"," **/"," findType: function (str) {"," if (Y.Color.KEYWORDS[str]) {"," return 'keyword';"," }",""," var index = str.indexOf('('),"," key;",""," if (index > 0) {"," key = str.substr(0, index);"," }",""," if (key && Y.Color.TYPES[key.toUpperCase()]) {"," return Y.Color.TYPES[key.toUpperCase()];"," }",""," return 'hex';",""," }, // return 'keyword', 'hex', 'rgb'",""," /**"," Retrives the alpha channel from the provided string. If no alpha"," channel is present, `1` will be returned."," @protected"," @method _getAlpha"," @param {String} clr"," @return {Number}"," @since 3.8.0"," **/"," _getAlpha: function (clr) {"," var alpha,"," arr = Y.Color.toArray(clr);",""," if (arr.length > 3) {"," alpha = arr.pop();"," }",""," return +alpha || 1;"," },",""," /**"," Returns the hex value string if found in the KEYWORDS object"," @protected"," @method _keywordToHex"," @param {String} clr"," @return {String}"," @since 3.8.0"," **/"," _keywordToHex: function (clr) {"," var keyword = Y.Color.KEYWORDS[clr];",""," if (keyword) {"," return keyword;"," }"," },",""," /**"," Converts the provided color string to the value type provided as `to`"," @protected"," @method _convertTo"," @param {String} clr"," @param {String} to"," @return {String}"," @since 3.8.0"," **/"," _convertTo: function(clr, to) {",""," if (clr === 'transparent') {"," return clr;"," }",""," var from = Y.Color.findType(clr),"," originalTo = to,"," needsAlpha,"," alpha,"," method,"," ucTo;",""," if (from === 'keyword') {"," clr = Y.Color._keywordToHex(clr);"," from = 'hex';"," }",""," if (from === 'hex' && clr.length < 5) {"," if (clr.charAt(0) === '#') {"," clr = clr.substr(1);"," }",""," clr = '#' + clr.charAt(0) + clr.charAt(0) +"," clr.charAt(1) + clr.charAt(1) +"," clr.charAt(2) + clr.charAt(2);"," }",""," if (from === to) {"," return clr;"," }",""," if (from.charAt(from.length - 1) === 'a') {"," from = from.slice(0, -1);"," }",""," needsAlpha = (to.charAt(to.length - 1) === 'a');"," if (needsAlpha) {"," to = to.slice(0, -1);"," alpha = Y.Color._getAlpha(clr);"," }",""," ucTo = to.charAt(0).toUpperCase() + to.substr(1).toLowerCase();"," method = Y.Color['_' + from + 'To' + ucTo ];",""," // check to see if need conversion to rgb first"," // check to see if there is a direct conversion method"," // convertions are: hex <-> rgb <-> hsl"," if (!method) {"," if (from !== 'rgb' && to !== 'rgb') {"," clr = Y.Color['_' + from + 'ToRgb'](clr);"," from = 'rgb';"," method = Y.Color['_' + from + 'To' + ucTo ];"," }"," }",""," if (method) {"," clr = ((method)(clr, needsAlpha));"," }",""," // process clr from arrays to strings after conversions if alpha is needed"," if (needsAlpha) {"," if (!Y.Lang.isArray(clr)) {"," clr = Y.Color.toArray(clr);"," }"," clr.push(alpha);"," clr = Y.Color.fromArray(clr, originalTo.toUpperCase());"," }",""," return clr;"," },",""," /**"," Processes the hex string into r, g, b values. Will return values as"," an array, or as an rgb string."," @protected"," @method _hexToRgb"," @param {String} str"," @param {Boolean} [toArray]"," @return {String|Array}"," @since 3.8.0"," **/"," _hexToRgb: function (str, toArray) {"," var r, g, b;",""," /*jshint bitwise:false*/"," if (str.charAt(0) === '#') {"," str = str.substr(1);"," }",""," str = parseInt(str, 16);",""," r = str >> 16;"," g = str >> 8 & 0xFF;"," b = str & 0xFF;",""," if (toArray) {"," return [r, g, b];"," }",""," return 'rgb(' + r + ', ' + g + ', ' + b + ')';"," },",""," /**"," Processes the rgb string into r, g, b values. Will return values as"," an array, or as a hex string."," @protected"," @method _rgbToHex"," @param {String} str"," @param {Boolean} [toArray]"," @return {String|Array}"," @since 3.8.0"," **/"," _rgbToHex: function (str) {"," /*jshint bitwise:false*/"," var rgb = Y.Color.toArray(str),"," hex = rgb[2] | (rgb[1] << 8) | (rgb[0] << 16);",""," hex = (+hex).toString(16);",""," while (hex.length < 6) {"," hex = '0' + hex;"," }",""," return '#' + hex;"," }","","};","","","","}, '3.13.0', {\"requires\": [\"yui-base\"]});","","}());"]};