From 4abf2969ca157ffde16420e39dc3a2963874319d Mon Sep 17 00:00:00 2001 From: vx-clutch Date: Wed, 31 Dec 2025 12:16:51 -0500 Subject: [PATCH] new hint ui function --- modules/ui/ui.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/ui/ui.go b/modules/ui/ui.go index b5d00a5..3ec152a 100644 --- a/modules/ui/ui.go +++ b/modules/ui/ui.go @@ -11,6 +11,10 @@ import ( "github.com/fatih/color" ) +const ( + hint_color = 0xbda02a +) + /* print out the current path (route) and relevant error */ func Path(path string, err error) { path = strings.TrimPrefix(path, "/") @@ -48,6 +52,16 @@ func Fatal(msg string, err error) error { panic(err) } +/* print a useful hint to the user */ +func Hint(format string, args ...any) { + color.RGB(func(hex int) (r, g, b int) { + r = (hex >> 16) & 0xFF + g = (hex >> 8) & 0xFF + b = hex & 0xFF + return + }(hint_color)).Printf("hint: %s\n", fmt.Sprintf(format, args...)) +} + /* print message using the ok status color */ func OK(msg string) { color.Green(msg)