mirror of
https://github.com/RGBCube/color.v
synced 2025-08-01 18:37:45 +00:00
Rename BasicStyle to StyleImpl
This commit is contained in:
parent
96f77d055c
commit
08c4e83c3a
2 changed files with 12 additions and 12 deletions
|
@ -21,16 +21,16 @@ pub const (
|
||||||
bright_cyan = Color(BasicColor.bright_cyan)
|
bright_cyan = Color(BasicColor.bright_cyan)
|
||||||
bright_white = Color(BasicColor.bright_white)
|
bright_white = Color(BasicColor.bright_white)
|
||||||
// Styles
|
// Styles
|
||||||
reset = Style(BasicStyle.reset)
|
reset = Style(StyleImpl.reset)
|
||||||
bold = Style(BasicStyle.bold)
|
bold = Style(StyleImpl.bold)
|
||||||
dim = Style(BasicStyle.dim)
|
dim = Style(StyleImpl.dim)
|
||||||
italic = Style(BasicStyle.italic)
|
italic = Style(StyleImpl.italic)
|
||||||
underline = Style(BasicStyle.underline)
|
underline = Style(StyleImpl.underline)
|
||||||
slow_blink = Style(BasicStyle.slow_blink)
|
slow_blink = Style(StyleImpl.slow_blink)
|
||||||
rapid_blink = Style(BasicStyle.rapid_blink)
|
rapid_blink = Style(StyleImpl.rapid_blink)
|
||||||
inverse = Style(BasicStyle.inverse)
|
inverse = Style(StyleImpl.inverse)
|
||||||
hidden = Style(BasicStyle.hidden)
|
hidden = Style(StyleImpl.hidden)
|
||||||
strikethrough = Style(BasicStyle.strikethrough)
|
strikethrough = Style(StyleImpl.strikethrough)
|
||||||
)
|
)
|
||||||
|
|
||||||
const no_color = !term.can_show_color_on_stdout()
|
const no_color = !term.can_show_color_on_stdout()
|
||||||
|
|
|
@ -18,7 +18,7 @@ pub fn (s Style) cprintln(msg string) {
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
|
||||||
enum BasicStyle {
|
enum StyleImpl {
|
||||||
reset
|
reset
|
||||||
bold
|
bold
|
||||||
dim
|
dim
|
||||||
|
@ -31,7 +31,7 @@ enum BasicStyle {
|
||||||
strikethrough
|
strikethrough
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn (s BasicStyle) render(msg string) string {
|
pub fn (s StyleImpl) render(msg string) string {
|
||||||
return if no_color {
|
return if no_color {
|
||||||
msg
|
msg
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue