mirror of
https://github.com/RGBCube/color.v
synced 2025-08-01 10:27:45 +00:00
Make the lib not make the compiler error out the ass
This commit is contained in:
parent
3f3b453fd4
commit
b89712d2da
3 changed files with 74 additions and 74 deletions
|
@ -60,18 +60,18 @@ enum BasicColor {
|
|||
red
|
||||
green
|
||||
yellow
|
||||
blue
|
||||
magenta
|
||||
cyan
|
||||
white
|
||||
bright_black
|
||||
bright_red
|
||||
bright_green
|
||||
bright_yellow
|
||||
bright_blue
|
||||
bright_magenta
|
||||
bright_cyan
|
||||
bright_white
|
||||
// blue
|
||||
// magenta
|
||||
// cyan
|
||||
// white
|
||||
// bright_black
|
||||
// bright_red
|
||||
// bright_green
|
||||
// bright_yellow
|
||||
// bright_blue
|
||||
// bright_magenta
|
||||
// bright_cyan
|
||||
// bright_white
|
||||
}
|
||||
|
||||
fn (c BasicColor) render(msg string) string {
|
||||
|
@ -83,18 +83,18 @@ fn (c BasicColor) render(msg string) string {
|
|||
.red { term.red }
|
||||
.green { term.green }
|
||||
.yellow { term.yellow }
|
||||
.blue { term.blue }
|
||||
.magenta { term.magenta }
|
||||
.cyan { term.cyan }
|
||||
.white { term.white }
|
||||
.bright_black { term.bright_black }
|
||||
.bright_red { term.bright_red }
|
||||
.bright_green { term.bright_green }
|
||||
.bright_yellow { term.bright_yellow }
|
||||
.bright_blue { term.bright_blue }
|
||||
.bright_magenta { term.bright_magenta }
|
||||
.bright_cyan { term.bright_cyan }
|
||||
.bright_white { term.bright_white }
|
||||
//.blue { term.blue }
|
||||
//.magenta { term.magenta }
|
||||
//.cyan { term.cyan }
|
||||
//.white { term.white }
|
||||
//.bright_black { term.bright_black }
|
||||
//.bright_red { term.bright_red }
|
||||
//.bright_green { term.bright_green }
|
||||
//.bright_yellow { term.bright_yellow }
|
||||
//.bright_blue { term.bright_blue }
|
||||
//.bright_magenta { term.bright_magenta }
|
||||
//.bright_cyan { term.bright_cyan }
|
||||
//.bright_white { term.bright_white }
|
||||
}
|
||||
|
||||
func(msg)
|
||||
|
@ -110,18 +110,18 @@ fn (c BasicColor) render_bg(msg string) string {
|
|||
.red { term.bg_red }
|
||||
.green { term.bg_green }
|
||||
.yellow { term.bg_yellow }
|
||||
.blue { term.bg_blue }
|
||||
.magenta { term.bg_magenta }
|
||||
.cyan { term.bg_cyan }
|
||||
.white { term.bg_white }
|
||||
.bright_black { term.bright_bg_black }
|
||||
.bright_red { term.bright_bg_red }
|
||||
.bright_green { term.bright_bg_green }
|
||||
.bright_yellow { term.bright_bg_yellow }
|
||||
.bright_blue { term.bright_bg_blue }
|
||||
.bright_magenta { term.bright_bg_magenta }
|
||||
.bright_cyan { term.bright_bg_cyan }
|
||||
.bright_white { term.bright_bg_white }
|
||||
//.blue { term.bg_blue }
|
||||
//.magenta { term.bg_magenta }
|
||||
//.cyan { term.bg_cyan }
|
||||
//.white { term.bg_white }
|
||||
//.bright_black { term.bright_bg_black }
|
||||
//.bright_red { term.bright_bg_red }
|
||||
//.bright_green { term.bright_bg_green }
|
||||
//.bright_yellow { term.bright_bg_yellow }
|
||||
//.bright_blue { term.bright_bg_blue }
|
||||
//.bright_magenta { term.bright_bg_magenta }
|
||||
//.bright_cyan { term.bright_bg_cyan }
|
||||
//.bright_white { term.bright_bg_white }
|
||||
}
|
||||
|
||||
func(msg)
|
||||
|
|
|
@ -4,33 +4,33 @@ import term
|
|||
|
||||
pub const (
|
||||
// Colors
|
||||
black = Color(BasicColor.black)
|
||||
red = Color(BasicColor.red)
|
||||
green = Color(BasicColor.green)
|
||||
yellow = Color(BasicColor.yellow)
|
||||
blue = Color(BasicColor.blue)
|
||||
magenta = Color(BasicColor.magenta)
|
||||
cyan = Color(BasicColor.cyan)
|
||||
white = Color(BasicColor.white)
|
||||
bright_black = Color(BasicColor.bright_black)
|
||||
bright_red = Color(BasicColor.bright_red)
|
||||
bright_green = Color(BasicColor.bright_green)
|
||||
bright_yellow = Color(BasicColor.bright_yellow)
|
||||
bright_blue = Color(BasicColor.bright_blue)
|
||||
bright_magenta = Color(BasicColor.bright_magenta)
|
||||
bright_cyan = Color(BasicColor.bright_cyan)
|
||||
bright_white = Color(BasicColor.bright_white)
|
||||
black = Color(BasicColor.black)
|
||||
red = Color(BasicColor.red)
|
||||
green = Color(BasicColor.green)
|
||||
yellow = Color(BasicColor.yellow)
|
||||
// blue = Color(BasicColor.blue)
|
||||
// magenta = Color(BasicColor.magenta)
|
||||
// cyan = Color(BasicColor.cyan)
|
||||
// white = Color(BasicColor.white)
|
||||
// bright_black = Color(BasicColor.bright_black)
|
||||
// bright_red = Color(BasicColor.bright_red)
|
||||
// bright_green = Color(BasicColor.bright_green)
|
||||
// bright_yellow = Color(BasicColor.bright_yellow)
|
||||
// bright_blue = Color(BasicColor.bright_blue)
|
||||
// bright_magenta = Color(BasicColor.bright_magenta)
|
||||
// bright_cyan = Color(BasicColor.bright_cyan)
|
||||
// bright_white = Color(BasicColor.bright_white)
|
||||
// Styles
|
||||
reset = Style(StyleImpl.reset)
|
||||
bold = Style(StyleImpl.bold)
|
||||
dim = Style(StyleImpl.dim)
|
||||
italic = Style(StyleImpl.italic)
|
||||
underline = Style(StyleImpl.underline)
|
||||
slow_blink = Style(StyleImpl.slow_blink)
|
||||
rapid_blink = Style(StyleImpl.rapid_blink)
|
||||
inverse = Style(StyleImpl.inverse)
|
||||
hidden = Style(StyleImpl.hidden)
|
||||
strikethrough = Style(StyleImpl.strikethrough)
|
||||
reset = Style(StyleImpl.reset)
|
||||
bold = Style(StyleImpl.bold)
|
||||
dim = Style(StyleImpl.dim)
|
||||
italic = Style(StyleImpl.italic)
|
||||
// underline = Style(StyleImpl.underline)
|
||||
// slow_blink = Style(StyleImpl.slow_blink)
|
||||
// rapid_blink = Style(StyleImpl.rapid_blink)
|
||||
// inverse = Style(StyleImpl.inverse)
|
||||
// hidden = Style(StyleImpl.hidden)
|
||||
// strikethrough = Style(StyleImpl.strikethrough)
|
||||
)
|
||||
|
||||
const no_color = !term.can_show_color_on_stdout()
|
||||
|
|
|
@ -23,12 +23,12 @@ enum StyleImpl {
|
|||
bold
|
||||
dim
|
||||
italic
|
||||
underline
|
||||
slow_blink
|
||||
rapid_blink
|
||||
inverse
|
||||
hidden
|
||||
strikethrough
|
||||
// underline
|
||||
// slow_blink
|
||||
// rapid_blink
|
||||
// inverse
|
||||
// hidden
|
||||
// strikethrough
|
||||
}
|
||||
|
||||
fn (s StyleImpl) render(msg string) string {
|
||||
|
@ -40,12 +40,12 @@ fn (s StyleImpl) render(msg string) string {
|
|||
.bold { term.bold }
|
||||
.dim { term.dim }
|
||||
.italic { term.italic }
|
||||
.underline { term.underline }
|
||||
.slow_blink { term.slow_blink }
|
||||
.rapid_blink { term.rapid_blink }
|
||||
.inverse { term.inverse }
|
||||
.hidden { term.hidden }
|
||||
.strikethrough { term.strikethrough }
|
||||
//.underline { term.underline }
|
||||
//.slow_blink { term.slow_blink }
|
||||
//.rapid_blink { term.rapid_blink }
|
||||
//.inverse { term.inverse }
|
||||
//.hidden { term.hidden }
|
||||
//.strikethrough { term.strikethrough }
|
||||
}
|
||||
|
||||
func(msg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue