mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[ts] Used lambda for Color.toRgb888
This commit is contained in:
parent
89831677e4
commit
8bca84f46e
@ -172,9 +172,7 @@ export class Color {
|
||||
}
|
||||
|
||||
toRgb888 () {
|
||||
function hex(x: number) {
|
||||
return ("0" + (x * 255).toString(16)).slice(-2);
|
||||
}
|
||||
const hex = (x: number) => ("0" + (x * 255).toString(16)).slice(-2);
|
||||
return Number("0x" + hex(this.r) + hex(this.g) + hex(this.b));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user