Skip to content

Commit

Permalink
fix(svg): stroke color grey when field is dark
Browse files Browse the repository at this point in the history
* works also for pean/ counter-ermine, etc.

Closes #6
  • Loading branch information
Benoit Lemoine committed Mar 30, 2020
1 parent 2d38962 commit f832b2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ exports[`CoatsOfArms should render 'Azure, two crosses moline counter ermine' 1`
onClick={[Function]}
onMouseDown={[Function]}
onMouseUp={[Function]}
stroke="#000"
stroke="#777"
strokeWidth={1}
style={
Object {
Expand All @@ -1380,7 +1380,7 @@ exports[`CoatsOfArms should render 'Azure, two crosses moline counter ermine' 1`
onClick={[Function]}
onMouseDown={[Function]}
onMouseUp={[Function]}
stroke="#000"
stroke="#777"
strokeWidth={1}
style={
Object {
Expand Down
5 changes: 4 additions & 1 deletion src/app/from-blason/blason.helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Blason, SimpleBlason } from '../model/blason';
import { areTinctureEquals, Furs, Tincture } from '../model/tincture';
import { areTinctureEquals, Furs, isFur, Tincture } from '../model/tincture';
import { cannotHappen } from '../../utils/cannot-happen';
import { Charge } from '../model/charge';
import { Field } from '../model/field';
Expand Down Expand Up @@ -98,5 +98,8 @@ export function isThereFur(blason: Blason, fur: Furs): boolean {
}

export function getStrokeColor(tincture: Tincture): string {
if (isFur(tincture)) {
return getStrokeColor(tincture.field);
}
return tincture.name === 'sable' ? '#777' : '#000';
}

0 comments on commit f832b2e

Please sign in to comment.