This commit is contained in:
Mahdi Abu Yasmine 2023-11-03 22:51:18 +01:00
parent 7e8dd4ae9d
commit 9574b3e083

View File

@ -5,6 +5,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"gitea.meta-tech.academy/go/core/util"
"github.com/gookit/color" "github.com/gookit/color"
) )
@ -56,7 +57,7 @@ func NewStyleByDef(def string) *Style {
if len(d) > KEY_STYLE_OPTION { if len(d) > KEY_STYLE_OPTION {
o = strings.Split(d[KEY_STYLE_OPTION], ",") o = strings.Split(d[KEY_STYLE_OPTION], ",")
} }
prependToSliceStr(&c, "#") util.PrependToSliceStr(&c, "#")
var s *color.RGBStyle var s *color.RGBStyle
switch len(c) { switch len(c) {
case 1: case 1:
@ -66,7 +67,7 @@ func NewStyleByDef(def string) *Style {
} }
for _, elm := range o { for _, elm := range o {
s.AddOpts(color.Color(str2int(elm, 10, 0))) s.AddOpts(color.Color(util.Str2int(elm, 10, 0)))
} }
// s.Printf(" %-20s\n", d[KEY_STYLE_NAME]) // s.Printf(" %-20s\n", d[KEY_STYLE_NAME])
return &Style{s, d[KEY_STYLE_NAME]} return &Style{s, d[KEY_STYLE_NAME]}