commit 4abf2969ca157ffde16420e39dc3a2963874319d
parent 1c229f1b3e0e4c160292360807879ba97ce73a3e
Author: vx-clutch <[email protected]>
Date: Wed, 31 Dec 2025 12:16:51 -0500
new hint ui function
Diffstat:
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git 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)