Last active
September 19, 2020 13:43
-
-
Save radgeRayden/dd702a0387acc31ba0a137c74ff15789 to your computer and use it in GitHub Desktop.
Color test for scopes styles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn test-color (style-kind) | |
let style-code = (default-styler style-kind "") | |
let styled-name = (default-styler style-kind (style-kind as string)) | |
let color-code = | |
do | |
let code = (lslice style-code ((countof style-code) - (countof "\x1b[0m"))) | |
match code | |
case "\x1b\[30m" | |
0 | |
case "\x1b[31m" | |
1 | |
case "\x1b[32m" | |
2 | |
case "\x1b[33m" | |
3 | |
case "\x1b[34m" | |
4 | |
case "\x1b[35m" | |
5 | |
case "\x1b[36m" | |
6 | |
case "\x1b[37m" | |
7 | |
case "\x1b[30;1m" | |
8 | |
case "\x1b[31;1m" | |
9 | |
case "\x1b[32;1m" | |
10 | |
case "\x1b[33;1m" | |
11 | |
case "\x1b[34;1m" | |
12 | |
case "\x1b[35;1m" | |
13 | |
case "\x1b[36;1m" | |
14 | |
case "\x1b[37;1m" | |
15 | |
default | |
-1 | |
io-write! | |
.. styled-name " - " (repr color-code) "\n" | |
test-color style-none | |
test-color style-symbol | |
test-color style-string | |
test-color style-number | |
test-color style-keyword | |
test-color style-function | |
test-color style-sfxfunction | |
test-color style-operator | |
test-color style-instruction | |
test-color style-type | |
test-color style-comment | |
test-color style-error | |
test-color style-warning | |
test-color style-location |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment