1
Fork 0
mirror of https://github.com/RGBCube/color.v synced 2025-08-01 10:27:45 +00:00

Remove redundancy

This commit is contained in:
RGBCube 2022-11-18 21:13:33 +03:00
parent 99349cb85d
commit cae034cfb3
3 changed files with 4 additions and 36 deletions

View file

@ -74,19 +74,3 @@ pub fn (c BasicColor) render_bg(msg string) string {
return func(msg)
}
pub fn (c BasicColor) cprint(msg string) {
print(c.render(msg))
}
pub fn (c BasicColor) cprint_bg(msg string) {
print(c.render_bg(msg))
}
pub fn (c BasicColor) cprintln(msg string) {
println(c.render(msg))
}
pub fn (c BasicColor) cprintln_bg(msg string) {
println(c.render_bg(msg))
}

View file

@ -11,17 +11,17 @@ pub fn (c Color) render_bg(msg string) string {
}
pub fn (c Color) cprint(msg string) {
c.cprint(msg)
print(c.render(msg))
}
pub fn (c Color) cprintln(msg string) {
c.cprintln(msg)
println(c.render(msg))
}
pub fn (c Color) cprint_bg(msg string) {
c.cprint_bg(msg)
print(c.render_bg(msg))
}
pub fn (c Color) cprintln_bg(msg string) {
c.cprintln_bg(msg)
println(c.render_bg(msg))
}

View file

@ -32,19 +32,3 @@ pub fn (c TrueColor) render(msg string) string {
pub fn (c TrueColor) render_bg(msg string) string {
return term.bg_rgb(c.r, c.g, c.b, msg)
}
pub fn (c TrueColor) cprint(msg string) {
print(c.render(msg))
}
pub fn (c TrueColor) cprint_bg(msg string) {
print(c.render_bg(msg))
}
pub fn (c TrueColor) cprintln(msg string) {
println(c.render(msg))
}
pub fn (c TrueColor) cprintln_bg(msg string) {
println(c.render_bg(msg))
}