don't mutate values passed to Ox.rgb and Ox.hsl
This commit is contained in:
parent
a6d4734bb3
commit
5209cf70d7
1 changed files with 2 additions and 1 deletions
|
@ -19,7 +19,7 @@ Ox.hsl = function(rgb) {
|
|||
if (arguments.length == 3) {
|
||||
rgb = Ox.makeArray(arguments);
|
||||
}
|
||||
rgb = rgb.map(function(val) {
|
||||
rgb = Ox.clone(rgb).map(function(val) {
|
||||
return val / 255;
|
||||
});
|
||||
var max = Ox.max(rgb),
|
||||
|
@ -66,6 +66,7 @@ Ox.rgb = function(hsl) {
|
|||
if (arguments.length == 3) {
|
||||
hsl = Ox.makeArray(arguments);
|
||||
}
|
||||
hsl = Ox.clone(hsl);
|
||||
hsl[0] /= 360;
|
||||
var rgb = [0, 0, 0],
|
||||
v1, v2, v3;
|
||||
|
|
Loading…
Reference in a new issue