(r, g, b)
| 748 | // Based on: http://www.easyrgb.com/math.php |
| 749 | |
| 750 | function _rgb2hex(r, g, b) { |
| 751 | /* Converts the given R,G,B values to a hexadecimal color string. |
| 752 | */ |
| 753 | parseHex = function(i) { |
| 754 | return ((i == 0)? "00" : (i.length < 2)? "0"+i : i).toString(16).toUpperCase(); |
| 755 | } |
| 756 | return "#" |
| 757 | + parseHex(Math.round(r * 255)) |
| 758 | + parseHex(Math.round(g * 255)) |
| 759 | + parseHex(Math.round(b * 255)); |
| 760 | } |
| 761 | |
| 762 | function _hex2rgb(hex) { |
| 763 | /* Converts the given hexadecimal color string to R,G,B (between 0.0-1.0). |
no outgoing calls
no test coverage detected
searching dependent graphs…