mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-06 09:02:50 +00:00
Reliably convert colors to hex strings
Converting a hex string to CPColor and back to a hex string now returns the same initial hex string. (Fixed an off-by-one error)
This commit is contained in:
1 parent
ce2c662872
commit
c78b5e580a
1 file changed
+1
-1
+1
-1
@@ -736,7 +736,7 @@ var byteToHex = function(n)
|
||||
if (!n || isNaN(n))
|
||||
return "00";
|
||||
|
||||
n = ROUND(MIN(255, MAX(0, 256 * n)));
|
||||
n = FLOOR(MIN(255, MAX(0, 256 * n)));
|
||||
|
||||
return hexCharacters.charAt((n - n % 16) / 16) +
|
||||
hexCharacters.charAt(n % 16);
|
||||
|
||||
Reference in new issue
Block a user