mirror of
https://github.com/deavmi/birchwood
synced 2024-09-20 14:23:38 +02:00
Add simpleColor function overloads
This commit is contained in:
parent
622d6e509d
commit
a4b75a322d
@ -18,7 +18,7 @@ enum ascii_color_code = '\x03';
|
||||
enum hex_color_code = '\x04';
|
||||
|
||||
// Simple color codes
|
||||
enum simple_colors: string {
|
||||
enum simpleColor: string {
|
||||
WHITE = "00",
|
||||
BLACK = "01",
|
||||
BLUE = "02",
|
||||
@ -78,6 +78,18 @@ string set_foreground_background(string fg, string bg) {
|
||||
return control_char ~ fg ~ "," ~ bg;
|
||||
}
|
||||
|
||||
// Generates a string that changes the foreground color (except enum)
|
||||
pragma(inline)
|
||||
string set_foreground(simpleColor color) {
|
||||
return ascii_color_code ~ color;
|
||||
}
|
||||
|
||||
// Generate a string that sets the foreground and background color (except enum)
|
||||
pragma(inline)
|
||||
string set_foreground_background(simpleColor fg, simpleColor bg) {
|
||||
return ascii_color_code ~ fg ~ "," ~ bg;
|
||||
}
|
||||
|
||||
// Generate a string that resets the foreground and background colors
|
||||
pragma(inline)
|
||||
string reset_fg_bg() {return ascii_color_code;}
|
||||
|
Loading…
Reference in New Issue
Block a user