Skip to content

Commit

Permalink
map colours (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
johenglisch authored Mar 29, 2023
1 parent 9f1e2eb commit 67c00fc
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions grambank/scripts/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ def import_features(cldf, contributors): # pragma: no cover
3 = orange cee7733
"""
features, codes = {}, {}
icons = [
'cffffff', # 'c0077bb'
'cff0000', # 'ccc3311'
'c0000ff', # 'c009988'
'cffff00', # 'cee7733'
]
icons = {
'?': 'cffffff',
'0': 'c009E73', # 'c00ffff',
'1': 'cF0E442', # 'c593d9c',
'2': 'c0072B2', # 'cf68f46',
'3': 'cD55E00', # 'c73d055',
}
domains = {}
for fid, des in itertools.groupby(
sorted(cldf['CodeTable'], key=lambda c: c['Parameter_ID']),
Expand All @@ -93,7 +94,7 @@ def import_features(cldf, contributors): # pragma: no cover
if code['Name'] == '?':
icon, number, value = 'tcccccc', 999, None
else:
icon, number, value = icons[int(code['Name'])], int(code['Name']), code['Name']
icon, number, value = icons[code['Name']], int(code['Name']), code['Name']
DomainElement(
id=code['ID'],
parameter=f,
Expand Down

0 comments on commit 67c00fc

Please sign in to comment.