amend NewStyleByDef
This commit is contained in:
parent
bd9a98cdc8
commit
5458ca37ba
|
@ -50,11 +50,16 @@ func (s *Style) Ln() {
|
||||||
|
|
||||||
func NewStyleByDef(def string) *Style {
|
func NewStyleByDef(def string) *Style {
|
||||||
var o []string = []string{}
|
var o []string = []string{}
|
||||||
|
var c []string = []string{"FFFFFF"}
|
||||||
d := strings.Fields(def)
|
d := strings.Fields(def)
|
||||||
c := strings.Split(d[KEY_STYLE_COLOR], ",")
|
|
||||||
|
if len(d) > KEY_STYLE_COLOR {
|
||||||
|
c = strings.Split(d[KEY_STYLE_COLOR], ",")
|
||||||
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], ",")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
util.PrependToSliceStr(&c, "#")
|
util.PrependToSliceStr(&c, "#")
|
||||||
var s *color.RGBStyle
|
var s *color.RGBStyle
|
||||||
switch len(c) {
|
switch len(c) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user