4 Commits

4 changed files with 13 additions and 8 deletions

View File

@@ -38,13 +38,13 @@ var possibleColors map[string]color = map[string]color{
"GREEN": {"GREEN", colorData.New(colorData.FgGreen)}, "GREEN": {"GREEN", colorData.New(colorData.FgGreen)},
"YELLOW": {"YELLOW", colorData.New(colorData.FgYellow)}, "YELLOW": {"YELLOW", colorData.New(colorData.FgYellow)},
"BLUE": {"BLUE", colorData.New(colorData.FgBlue)}, "BLUE": {"BLUE", colorData.New(colorData.FgBlue)},
"MAGENTA": {"MAGENTA", colorData.New(38, 2, 254, 141, 255)}, "MAGENTA": {"MAGENTA", colorData.New(colorData.FgMagenta)},
"CYAN": {"CYAN", colorData.New(colorData.FgCyan)}, "CYAN": {"CYAN", colorData.New(colorData.FgCyan)},
"WHITE": {"WHITE", colorData.New(colorData.FgWhite)}, "WHITE": {"WHITE", colorData.New(colorData.FgWhite)},
"GRAY": {"GRAY", colorData.New(colorData.FgWhite, colorData.Faint)}, "GRAY": {"GRAY", colorData.New(colorData.FgWhite, colorData.Faint)},
// Last three numbers are RGB. Reference https://en.wikipedia.org/wiki/ANSI_escape_code for what the first two numbers mean. // Last three numbers are RGB. Reference https://en.wikipedia.org/wiki/ANSI_escape_code for what the first two numbers mean.
"ORANGE": {"ORANGE", colorData.New(38, 2, 255, 153, 28)}, // "ORANGE": {"ORANGE", colorData.New(38, 2, 255, 153, 28)},
"DARKBLUE": {"DARKBLUE", colorData.New(38, 2, 0, 112, 255)}, // "DARKBLUE": {"DARKBLUE", colorData.New(38, 2, 0, 112, 255)},
"NONE": {"NONE", colorData.New()}, "NONE": {"NONE", colorData.New()},
} }

View File

@@ -5,3 +5,4 @@
PINK: 38 244 211 244 22 PINK: 38 244 211 244 22
BOLD_WHITE: 38 -1 -1 -1 1 BOLD_WHITE: 38 -1 -1 -1 1
ITALIC_WHITE: 38 -1 -1 -1 3 ITALIC_WHITE: 38 -1 -1 -1 3
UNDERLINE_WHITE: 38 -1 -1 -1 4

View File

@@ -18,11 +18,9 @@
'(&&)|(\|\|)': CYAN '(&&)|(\|\|)': CYAN
# Keywords # Keywords
'\b(if|else|for|range|go|func|return|break|continue)\b': CYAN '\b(if|else|for|range|go|func|return|break|continue)\b': CYAN
'\b(import|var|const|type|struct)\b': CYAN '\b(package|import|var|const|type|struct)\b': CYAN
# Built-in Functions # Built-in Functions
'\b(panic|len)\b': DARKBLUE '\b(panic|len)\b': GREEN
# Functions from packages (package name and function name separated by dot)
'\b(\w*\.\w*)\b': DARKBLUE
# Data Types # Data Types
'\b(bool|byte|rune|string|interface|map|chan)\b': YELLOW '\b(bool|byte|rune|string|interface|map|chan)\b': YELLOW
'\b(u?int)(8|16|32|64)?\b': YELLOW '\b(u?int)(8|16|32|64)?\b': YELLOW

View File

@@ -1,7 +1,13 @@
# Priority decreases going downward ie. If two regexes match the same piece of # Priority decreases going downward ie. If two regexes match the same piece of
# text, the one defined earlier will take precedence over the one defined later. # text, the one defined earlier will take precedence over the one defined later.
# Headings # Headings
'##?#?#?#?#?.*': MAGENTA '^#{1,6}.*?$': MAGENTA
# Link text
'\[.*?\](?=\(.*?\))': UNDERLINE_WHITE
# Link URL
'https?://\w+\.\w+.*?(?=\))': RED
# Code blocks # Code blocks
'```(.|\n)+?```': YELLOW '```(.|\n)+?```': YELLOW