mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
introduce Color.Format
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user