was.js
/trunk/lib/physics/colorimetry.js |
@@ -1,7 +1,7 @@ |
/*************************************************************************/ |
/* Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 */ |
/*************************************************************************/ |
function wasHexToRGB(hex) { |
function HexToRGB(hex) { |
var shortRegEx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; |
hex = hex.replace( |
shortRegEx, |
@@ -16,16 +16,4 @@ |
g: parseInt(result[2], 16), |
b: parseInt(result[3], 16) |
} : null; |
} |
|
/*************************************************************************/ |
/* Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 */ |
/*************************************************************************/ |
function wasRGBToHex(r, g, b) { |
return "#" + ( |
(1 << 24) + |
(r << 16) + |
(g << 8) + |
b |
).toString(16).slice(1); |
} |
} |