Skip to content

Commit

Permalink
Merge pull request aziz#51 from hadisfr/master
Browse files Browse the repository at this point in the history
Add supporting of bright 3/4 bit colors
  • Loading branch information
jfcherng authored Aug 3, 2018
2 parents 629d9a5 + c93828b commit 894ff03
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ansi.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,48 @@
"ANSI_FG": [
{"scope": "black", "code": "\\x1b\\[(0{,2};)?30m", "color": "#000000"},
{"scope": "black_light", "code": "\\x1b\\[1;30m", "color": "#686868"},
{"scope": "black_bright", "code": "\\x1b\\[90m", "color": "#686868"},
{"scope": "red", "code": "\\x1b\\[(0{,2};)?31m", "color": "#c71e12"},
{"scope": "red_light", "code": "\\x1b\\[1;31m", "color": "#ff6f6b"},
{"scope": "red_bright", "code": "\\x1b\\[91m", "color": "#ff6f6b"},
{"scope": "green", "code": "\\x1b\\[(0{,2};)?32m", "color": "#00c120"},
{"scope": "green_light", "code": "\\x1b\\[1;32m", "color": "#67f86f"},
{"scope": "green_bright", "code": "\\x1b\\[92m", "color": "#67f86f"},
{"scope": "yellow", "code": "\\x1b\\[(0{,2};)?33m", "color": "#c7c327"},
{"scope": "yellow_light", "code": "\\x1b\\[1;33m", "color": "#fffa72"},
{"scope": "yellow_bright", "code": "\\x1b\\[93m", "color": "#fffa72"},
{"scope": "blue", "code": "\\x1b\\[(0{,2};)?34m", "color": "#0a2fc4"},
{"scope": "blue_light", "code": "\\x1b\\[1;34m", "color": "#6a76fc"},
{"scope": "blue_bright", "code": "\\x1b\\[94m", "color": "#6a76fc"},
{"scope": "magenta", "code": "\\x1b\\[(0{,2};)?35m", "color": "#c839c5"},
{"scope": "magenta_light", "code": "\\x1b\\[1;35m", "color": "#ff7cfd"},
{"scope": "magenta_bright", "code": "\\x1b\\[95m", "color": "#ff7cfd"},
{"scope": "cyan", "code": "\\x1b\\[(0{,2};)?36m", "color": "#01c5c6"},
{"scope": "cyan_light", "code": "\\x1b\\[1;36m", "color": "#68fdfe"},
{"scope": "cyan_bright", "code": "\\x1b\\[96m", "color": "#68fdfe"},
{"scope": "white", "code": "\\x1b\\[(0{,2};)?(37)?m", "color": "#c7c7c7"},
{"scope": "white_light", "code": "\\x1b\\[1;37m", "color": "#ffffff"},
{"scope": "white_bright", "code": "\\x1b\\[97m", "color": "#ffffff"},
{"scope": "_bold", "code": "\\x1b\\[(0{,2};)?1m", "color": "#ffffff", "font_style": "bold"}
],
"ANSI_BG": [
{"scope": "", "code": "(?<!\\x1b\\[0;4[01234567]m)(?<!\\x1b\\[4[01234567]m)", "color": "#010000"},
{"scope": "_bg_black", "code": "\\x1b\\[(0{,2};)?40m", "color": "#222222"},
{"scope": "_bg_black_bright", "code": "\\x1b\\[(0{,2};)?100m", "color": "#686868"},
{"scope": "_bg_red", "code": "\\x1b\\[(0{,2};)?41m", "color": "#c71e12"},
{"scope": "_bg_red_bright", "code": "\\x1b\\[(0{,2};)?101m", "color": "#ff6f6b"},
{"scope": "_bg_green", "code": "\\x1b\\[(0{,2};)?42m", "color": "#00c120"},
{"scope": "_bg_green_bright", "code": "\\x1b\\[(0{,2};)?102m", "color": "#67f86f"},
{"scope": "_bg_yellow", "code": "\\x1b\\[(0{,2};)?43m", "color": "#c7c327"},
{"scope": "_bg_yellow_bright", "code": "\\x1b\\[(0{,2};)?103m", "color": "#fffa72"},
{"scope": "_bg_blue", "code": "\\x1b\\[(0{,2};)?44m", "color": "#0a2fc4"},
{"scope": "_bg_blue_bright", "code": "\\x1b\\[(0{,2};)?104m", "color": "#6a76fc"},
{"scope": "_bg_magenta", "code": "\\x1b\\[(0{,2};)?45m", "color": "#c839c5"},
{"scope": "_bg_magenta_bright", "code": "\\x1b\\[(0{,2};)?105m", "color": "#ff7cfd"},
{"scope": "_bg_cyan", "code": "\\x1b\\[(0{,2};)?46m", "color": "#01c5c6"},
{"scope": "_bg_cyan_bright", "code": "\\x1b\\[(0{,2};)?106m", "color": "#68fdfe"},
{"scope": "_bg_white", "code": "\\x1b\\[(0{,2};)?47m", "color": "#c7c7c7"},
{"scope": "_bg_white_bright", "code": "\\x1b\\[(0{,2};)?107m", "color": "#ffffff"},
{"scope": "_bold", "code": "\\x1b\\[(0{,2};)?1m", "color": "#010000", "font_style": "bold"}
],
"GENERAL": {
Expand Down
36 changes: 36 additions & 0 deletions test/ansi_test_file.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,56 @@
1m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
30m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;30m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
90m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
31m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;31m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
91m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
32m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;32m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
92m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
33m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;33m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
93m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
34m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;34m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
94m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
35m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;35m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
95m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
36m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;36m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
96m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
37m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;37m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
97m  Color   Color   Color   Color   Color   Color   Color   Color   Color 

100m 101m 102m 103m 104m 105m 106m 107m
m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
30m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;30m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
90m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
31m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;31m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
91m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
32m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;32m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
92m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
33m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;33m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
93m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
34m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;34m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
94m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
35m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;35m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
95m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
36m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;36m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
96m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
37m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
1;37m  Color   Color   Color   Color   Color   Color   Color   Color   Color 
97m  Color   Color   Color   Color   Color   Color   Color   Color   Color 

Unsupported ANSI escape codes:

Expand Down

0 comments on commit 894ff03

Please sign in to comment.