Float Alpha

This commit is contained in:
rebornix
2017-08-18 16:55:51 -07:00
parent cc5e2fb18d
commit 1bad719ea4
9 changed files with 149 additions and 150 deletions

View File

@@ -1029,14 +1029,14 @@ export class Color {
static fromHSLA(hue: number, saturation: number, luminance: number, alpha: number): Color {
const color = new BaseColor(new HSLA(hue, saturation, luminance, alpha)).rgba;
return new Color(color.r, color.g, color.b, color.a / 255);
return new Color(color.r, color.g, color.b, color.a);
}
static fromHex(hex: string): Color | null {
let baseColor = BaseColor.Format.CSS.parseHex(hex);
if (baseColor) {
const rgba = baseColor.rgba;
return new Color(rgba.r, rgba.g, rgba.b, rgba.a / 255);
return new Color(rgba.r, rgba.g, rgba.b, rgba.a);
}
return null;
}