Skip to content

Commit 51a3d31

Browse files
authored
Merge pull request #32 from Kanahiro/feat/ui
fix: parsing rgba()
2 parents 893f8ac + 890a0a5 commit 51a3d31

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "MapLibre",
44
"description": "",
55
"publisher": "kiguchi",
6-
"version": "0.2.0",
6+
"version": "0.2.1",
77
"engines": {
88
"vscode": "^1.92.0"
99
},

src/panels/layerEditor.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@
283283
if (!color) return '#000000';
284284
if (color.startsWith('#')) return color;
285285
if (color.startsWith('rgb')) {
286-
const match = color.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
286+
// Handle both rgb() and rgba()
287+
const match = color.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);
287288
if (match) {
288289
const r = parseInt(match[1]).toString(16).padStart(2, '0');
289290
const g = parseInt(match[2]).toString(16).padStart(2, '0');

0 commit comments

Comments
 (0)