Skip to content

Commit

Permalink
Merge pull request #95 from jeronimoek/fix-alpha-zero-colors
Browse files Browse the repository at this point in the history
fix: alpha 0 colors
  • Loading branch information
jeronimoek committed Nov 3, 2023
2 parents 878272d + f87f81f commit 1d8b2a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ export function parseColorString(initialColor: string) {
try {
const colorRaw = initialColor.toLocaleLowerCase();
const color = new ColorTranslatorExtended(colorRaw);
const { r, g, b, alpha = 1 } = color.rgb;
return new vscode.Color(r / 255, g / 255, b / 255, alpha || 1);
const { r, g, b, alpha } = color.rgb;
return new vscode.Color(r / 255, g / 255, b / 255, alpha ?? 1);
} catch (error) {
return null;
}
Expand Down

0 comments on commit 1d8b2a6

Please sign in to comment.