From cae034cfb33613420a030b045004562b5696fb79 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Fri, 18 Nov 2022 21:13:33 +0300 Subject: [PATCH] Remove redundancy --- color/basic_color.v | 16 ---------------- color/color.v | 8 ++++---- color/true_color.v | 16 ---------------- 3 files changed, 4 insertions(+), 36 deletions(-) diff --git a/color/basic_color.v b/color/basic_color.v index 7fc1223..f0ffe03 100644 --- a/color/basic_color.v +++ b/color/basic_color.v @@ -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)) -} diff --git a/color/color.v b/color/color.v index d5961b0..a4806b5 100644 --- a/color/color.v +++ b/color/color.v @@ -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)) } diff --git a/color/true_color.v b/color/true_color.v index 3456de0..f7ec562 100644 --- a/color/true_color.v +++ b/color/true_color.v @@ -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)) -}