Skip to content

Commit

Permalink
Use transparence from default style
Browse files Browse the repository at this point in the history
  • Loading branch information
svaabs committed Mar 26, 2020
1 parent ebff3be commit 164e59c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions contribs/gmf/src/search/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -848,19 +848,17 @@ class SearchController {
if (this.color) {
const color = asColorArray(this.color);

const strokeColor = color.slice();
// 100% opacity for the stroke color
strokeColor[3] = 1;

const fillColor = color.slice();
// 50% opacity for the fill color
fillColor[3] = 0.5;

const strokeStyle = style.getStroke();
const prevStrokeColor = strokeStyle.getColor();
const strokeColor = color.slice();
strokeColor[3] = prevStrokeColor[3];
if (strokeStyle) {
strokeStyle.setColor(strokeColor);
}
const fillStyle = style.getFill();
const prevFillColor = fillStyle.getColor();
const fillColor = color.slice();
fillColor[3] = prevFillColor[3];
if (fillStyle) {
fillStyle.setColor(fillColor);
}
Expand Down

0 comments on commit 164e59c

Please sign in to comment.