MCPcopy Create free account
hub / github.com/openclaw/gogcli / Color

Function Color

internal/docsformat/format.go:520–527  ·  view source on GitHub ↗

Color parses a Docs color flag in #RRGGBB or #RGB form.

(hex, flag string)

Source from the content-addressed store, hash-verified

518
519// Color parses a Docs color flag in #RRGGBB or #RGB form.
520func Color(hex, flag string) (*docs.OptionalColor, error) {
521 r, g, b, ok := parseHexColor(hex)
522 if !ok {
523 return nil, invalidf("%s must be #RRGGBB or #RGB", flag)
524 }
525
526 return &docs.OptionalColor{Color: &docs.Color{RgbColor: &docs.RgbColor{Red: r, Green: g, Blue: b}}}, nil
527}
528
529func formatAlignment(value string) (string, error) {
530 switch strings.ToLower(strings.TrimSpace(value)) {

Callers 2

docsFormatColorFunction · 0.92
buildTextStyleRequestFunction · 0.85

Calls 2

parseHexColorFunction · 0.70
invalidfFunction · 0.70

Tested by

no test coverage detected