From 90ef8ab5c64bf27adc7cc34bbb4bb654fb62b6ec Mon Sep 17 00:00:00 2001 From: RGBCube Date: Sat, 19 Nov 2022 19:06:22 +0300 Subject: [PATCH] Remove redundant pub --- color/basic_color.v | 4 ++-- color/true_color.v | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/color/basic_color.v b/color/basic_color.v index db4eb9d..4706f2b 100644 --- a/color/basic_color.v +++ b/color/basic_color.v @@ -21,7 +21,7 @@ enum BasicColor { bright_white } -pub fn (c BasicColor) render(msg string) string { +fn (c BasicColor) render(msg string) string { func := match c { .black { term.black } .red { term.red } @@ -44,7 +44,7 @@ pub fn (c BasicColor) render(msg string) string { return func(msg) } -pub fn (c BasicColor) render_bg(msg string) string { +fn (c BasicColor) render_bg(msg string) string { func := match c { .black { term.bg_black } .red { term.bg_red } diff --git a/color/true_color.v b/color/true_color.v index 84c2295..e216daf 100644 --- a/color/true_color.v +++ b/color/true_color.v @@ -2,12 +2,6 @@ module color import term -struct TrueColor { - r int - g int - b int -} - pub fn rgb(r int, g int, b int) !Color { if r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255 { return error('Red, green and blue must each be between 0 and 255') @@ -24,10 +18,16 @@ pub fn hex(hex int) !Color { return rgb(hex >> 16, hex >> 8 & 0xFF, hex & 0xFF)! } -pub fn (c TrueColor) render(msg string) string { +struct TrueColor { + r int + g int + b int +} + +fn (c TrueColor) render(msg string) string { return term.rgb(c.r, c.g, c.b, msg) } -pub fn (c TrueColor) render_bg(msg string) string { +fn (c TrueColor) render_bg(msg string) string { return term.bg_rgb(c.r, c.g, c.b, msg) }