perf: hsl
This commit is contained in:
parent
c1a090688e
commit
ecd26f0ddb
|
@ -67,8 +67,9 @@ export default class Sprite extends Component {
|
|||
return this.$$hue;
|
||||
}
|
||||
set hue(hue) {
|
||||
this.$$hue = hue;
|
||||
const [, s, l] = hexToHsl(this.$$tint);
|
||||
this.tint = hslToHex(hue, s, l);
|
||||
super.tint = hslToHex(hue, s, l);
|
||||
}
|
||||
initialize(values, defaults) {
|
||||
let {
|
||||
|
@ -87,8 +88,9 @@ export default class Sprite extends Component {
|
|||
return this.$$lightness;
|
||||
}
|
||||
set lightness(lightness) {
|
||||
this.$$lightness = lightness;
|
||||
const [h, s] = hexToHsl(this.$$tint);
|
||||
this.tint = hslToHex(h, s, lightness);
|
||||
super.tint = hslToHex(h, s, lightness);;
|
||||
}
|
||||
get rotates() {
|
||||
if (!this.$$sourceJson.meta) {
|
||||
|
@ -106,8 +108,9 @@ export default class Sprite extends Component {
|
|||
return this.$$saturation;
|
||||
}
|
||||
set saturation(saturation) {
|
||||
this.$$saturation = saturation;
|
||||
const [h, , l] = hexToHsl(this.$$tint);
|
||||
this.tint = hslToHex(h, saturation, l);
|
||||
super.tint = hslToHex(h, saturation, l);
|
||||
}
|
||||
get scale() {
|
||||
return this.$$scale;
|
||||
|
|
Loading…
Reference in New Issue
Block a user