Skip to content

Commit

Permalink
opacity fix
Browse files Browse the repository at this point in the history
  • Loading branch information
0xDaksh committed Apr 25, 2018
1 parent e2fbd35 commit 4edc798
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export function activate(context: vscode.ExtensionContext) {
if(editor.document.getText(editor.selection) !== '') {
editor.edit((edit) => {
let value = editor.document.getText(editor.selection);
edit.replace(editor.selection, HexToRGBA(value.split('_')[0], value.split('_')[1]));
let opacity = value.split('_')[1];
edit.replace(editor.selection, HexToRGBA(value.split('_')[0], typeof opacity !== 'undefined' ? opacity : 100));
})
} else {
vscode.window.showErrorMessage('Select Something to convert to RGBA')
Expand Down

0 comments on commit 4edc798

Please sign in to comment.