introduce Color.Format

This commit is contained in:
Joao Moreno
2017-08-08 16:53:11 +02:00
parent bac7689b0b
commit de78bd66a6
18 changed files with 185 additions and 175 deletions

View File

@@ -1031,12 +1031,12 @@ export class Color {
if (!alpha) {
alpha = 1;
}
const color = CommonColor.fromHSLA(new HSLA(hue, saturation, luminosity, alpha)).toRGBA();
const color = CommonColor.fromHSLA(new HSLA(hue, saturation, luminosity, alpha)).rgba;
return new Color(color.r, color.g, color.b, color.a / 255);
}
static fromHex(hex: string): Color {
const color = CommonColor.fromHex(hex).toRGBA();
const color = CommonColor.fromHex(hex).rgba;
return new Color(color.r, color.g, color.b, color.a / 255);
}
}