prep for release v0.0.2 #1

Merged
HEL merged 13 commits from dev into main 2024-06-15 12:20:48 +00:00
6 changed files with 53 additions and 1 deletions
Showing only changes of commit 995564382a - Show all commits

View File

@ -101,5 +101,11 @@
}
}
}
},
"colors": {
"main": {
"31-28": "#FF0000",
"11-4": [34, 176, 43]
}
}
}

Binary file not shown.

View File

@ -65,4 +65,7 @@
<description>offset register</description>
</range>
</structure>
<color structure="main" color="#FF0000" start="28" end="31" />
<color structure="main" color="#255961" start="4" end="11" />
<color structure="immediateOffset" color="89,97,37" start="4" end="11" />
</schema>

View File

@ -71,3 +71,11 @@ structures:
3-0:
name: Rm
description: offset register
colors:
main:
31-28: "#3EFA6B"
25-23:
- 100
- 150
- 200

View File

@ -50,6 +50,28 @@
parse-raw(path-or-schema)
}
if "colors" in schema {
for struct in schema.colors.keys() {
for (span, col) in schema.colors.at(struct) {
if type(col) == str {
if col.starts-with("#") {
col = rgb(col)
} else {
let (r, g, b) = col.split(",").map(v => int(v))
col = rgb(r, g, b)
}
} else if type(col) == array {
col = rgb(..col)
} else if type(col) != color {
panic("Invalid color format")
}
schema.colors.at(struct).at(span) = col
}
}
} else {
schema.insert("colors", (:))
}
let structures = (:)
for (id, data) in schema.structures {
id = str(id)

View File

@ -83,8 +83,10 @@
#let parse(content) = {
let struct-elmts = content.children.filter(e => "tag" in e and e.tag == "structure")
let color-elmts = content.children.filter(e => "tag" in e and e.tag == "color")
let structures = (:)
let colors = (:)
for struct-elmt in struct-elmts {
structures.insert(
@ -93,8 +95,19 @@
)
}
for color-elmt in color-elmts {
let struct = color-elmt.attrs.structure
if not struct in colors {
colors.insert(struct, (:))
}
let span = color-elmt.attrs.end + "-" + color-elmt.attrs.start
colors.at(struct).insert(span, color-elmt.attrs.color)
}
return (
structures: structures
structures: structures,
colors: colors
)
}