add themed colored elements
This commit is contained in:
parent
fb2ae1dee2
commit
188656bd99
5 changed files with 147 additions and 130 deletions
|
|
@ -97,4 +97,23 @@ Ox.rgb = function(hsl) {
|
|||
return rgb.map(function(v) {
|
||||
return v * 255;
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
/*@
|
||||
Ox.toHex <f> Format RGB array as hex value
|
||||
@*/
|
||||
Ox.toHex = function(rgb) {
|
||||
return rgb.map(function(val) {
|
||||
return Ox.pad(val.toString(16).toUpperCase(), 2);
|
||||
}).join('');
|
||||
};
|
||||
|
||||
/*@
|
||||
Ox.toRGB <f> Format hex value as RGB array
|
||||
@*/
|
||||
Ox.toRGB = function(hex) {
|
||||
return Ox.range(3).map(function(i) {
|
||||
return parseInt(hex.substr(i * 2, 2), 16);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue