forked from 0x2620/oxjs
make Ox.rgb always return integers
This commit is contained in:
parent
fa84921333
commit
d29bc5569b
4 changed files with 9 additions and 25 deletions
|
|
@ -80,9 +80,7 @@ Ox.ColorInput = function(options, self) {
|
|||
function getRGB() {
|
||||
return self.options.mode == 'rgb'
|
||||
? self.options.value
|
||||
: Ox.rgb(self.options.value).map(function(value) {
|
||||
return Math.round(value);
|
||||
});
|
||||
: Ox.rgb(self.options.value);
|
||||
}
|
||||
|
||||
return that;
|
||||
|
|
|
|||
|
|
@ -109,11 +109,7 @@ Ox.ColorPicker = function(options, self) {
|
|||
}
|
||||
|
||||
function getRGB(values) {
|
||||
return self.options.mode == 'rgb'
|
||||
? values
|
||||
: Ox.rgb(values).map(function(value) {
|
||||
return Math.round(value);
|
||||
});
|
||||
return self.options.mode == 'rgb' ? values : Ox.rgb(values);
|
||||
}
|
||||
|
||||
return that;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue