mirror of
https://github.com/RGBCube/color.v
synced 2025-08-01 10:27: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_white = Color(BasicColor.bright_white)
|
||||
// Styles
|
||||
reset = Style(BasicStyle.reset)
|
||||
bold = Style(BasicStyle.bold)
|
||||
dim = Style(BasicStyle.dim)
|
||||
italic = Style(BasicStyle.italic)
|
||||
underline = Style(BasicStyle.underline)
|
||||
slow_blink = Style(BasicStyle.slow_blink)
|
||||
rapid_blink = Style(BasicStyle.rapid_blink)
|
||||
inverse = Style(BasicStyle.inverse)
|
||||
hidden = Style(BasicStyle.hidden)
|
||||
strikethrough = Style(BasicStyle.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()
|
||||
|
|
|
@ -18,7 +18,7 @@ pub fn (s Style) cprintln(msg string) {
|
|||
|
||||
// Implementation
|
||||
|
||||
enum BasicStyle {
|
||||
enum StyleImpl {
|
||||
reset
|
||||
bold
|
||||
dim
|
||||
|
@ -31,7 +31,7 @@ enum BasicStyle {
|
|||
strikethrough
|
||||
}
|
||||
|
||||
pub fn (s BasicStyle) render(msg string) string {
|
||||
pub fn (s StyleImpl) render(msg string) string {
|
||||
return if no_color {
|
||||
msg
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue