(hex)
| 760 | } |
| 761 | |
| 762 | function _hex2rgb(hex) { |
| 763 | /* Converts the given hexadecimal color string to R,G,B (between 0.0-1.0). |
| 764 | */ |
| 765 | hex = hex.replace(/^#/, ""); |
| 766 | if (hex.length < 6) { // hex += hex[-1] * (6-hex.length); |
| 767 | hex += (new Array(6-hex.length)).join(hex.substr(hex.length-1)); |
| 768 | } |
| 769 | var r = parseInt(hex.substr(0, 2), 16) / 255; |
| 770 | var g = parseInt(hex.substr(2, 2), 16) / 255; |
| 771 | var b = parseInt(hex.substr(4, 2), 16) / 255; |
| 772 | return [r, g, b]; |
| 773 | } |
| 774 | |
| 775 | function _rgb2hsb(r, g, b) { |
| 776 | /* Converts the given R,G,B values to H,S,B (between 0.0-1.0). |
no outgoing calls
no test coverage detected
searching dependent graphs…