More work on porting diff kitten

This commit is contained in:
Kovid Goyal
2023-03-20 18:15:18 +05:30
parent 1c7d1094d4
commit 648925e83a
3 changed files with 21 additions and 11 deletions

View File

@@ -158,14 +158,14 @@ func ParseColor(color string) (RGBA, error) {
}
type NullableColor struct {
Color RGBA
IsNull bool
Color RGBA
IsSet bool
}
func ParseColorOrNone(color string) (NullableColor, error) {
raw := strings.TrimSpace(strings.ToLower(color))
if raw == "none" {
return NullableColor{IsNull: true}, nil
return NullableColor{}, nil
}
c, err := ParseColor(raw)
return NullableColor{Color: c}, err