christianvoigt/argdown

VSCode Extension argdown.config.json: Incorrect syntax errors when using unquoted integers for relationsColors

s6mike opened this issue · 0 comments

Actually after further testing, I can use unquoted values in relationColors, and it will correctly use the palette number despite the syntax errors.

So the issue here is that using unquoted integers with relationColors triggers syntax errors (apart from 'contrary' which accepts unquoted integers), when it shouldn't because these are valid values for selecting palette index numbers.


Original issue details:

Putting this into argdown.config.json didn't work, all relations showed up as black:

"color": {
"colorScheme": "colorbrewer-paired",
"relationColors": {
"support": "3",
"entails": "3",
"attack": "5",
"contrary": "5",
"contradictory": "5",
"undercut": "2"
},

Changing it to this did work:
"relationColors": {
"support": "#2ca02c",
"entails": "#2ca02c",
"attack": "#d62728",
"contrary": "#d62728",
"contradictory": "#d62728",
"undercut": "#9467bd"
},

Note that, unlike "tagColors", syntax errors appear for relationColors when trying to use unquoted numbers (except for "contrary" relation). Might be that quoting forces numbers to be interpreted as hex rather than colour palette index number.

Version: 1.67.2
Commit: c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
Date: 2022-05-17T18:23:40.286Z
Electron: 17.4.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Linux x64 5.10.106-15290-g6e9d70c8a9b4