Skip to content

Commit 7a29191

Browse files
committed
Set fill color from tracker status color with alpha 0.2
Signed-off-by: Ko Nagase <[email protected]>
1 parent 2934913 commit 7a29191

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/components/gtt-client.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,11 @@ export class GttClient {
604604
this.layerArray[index].setVisible(true)
605605
}
606606

607-
getColor(feature: Feature<Geometry>): string {
607+
getColor(feature: Feature<Geometry>, isFill: boolean = false): string {
608608
let color = '#000000'
609+
if (feature.getGeometry().getType() !== 'Point') {
610+
color = '#FFD700'
611+
}
609612
const plugin_settings = JSON.parse(this.defaults.pluginSettings)
610613
const status = document.querySelector('#issue_status_id') as HTMLInputElement
611614

@@ -619,6 +622,9 @@ export class GttClient {
619622
color = plugin_settings[key]
620623
}
621624
}
625+
if (isFill && color !== null && color.length === 7) {
626+
color = color + '33' // Add alpha: 0.2
627+
}
622628
return color
623629
}
624630

@@ -692,7 +698,7 @@ export class GttClient {
692698
color: self.getColor(feature)
693699
}),
694700
fill: new Fill({
695-
color: [255, 136, 0, 0.2]
701+
color: self.getColor(feature, true),
696702
})
697703
})
698704
)

0 commit comments

Comments
 (0)