// HasCorrectColors verifies that the format of each color is correct
2555
func HasCorrectColors(c *chronograf.DashboardCell) error {
	for _, color := range c.CellColors {
		if !oneOf(color.Type, "max", "min", "threshold", "text", "background", "scale") {
			return chronograf.ErrInvalidColorType
		}
		if len(color.Hex) != 7 {
			return chronograf.ErrInvalidColor
		}
	}
	return nil
}
1330722
func IsColor(ctx context.Context) bool {
	bv, ok := ctx.Value(ctxKeyColor).(bool)
	if !ok {
		return true
	}
	return bv
}
286178
func IsColor(s string) bool {
	r := []rune(s)
	if len(r) != 2 {
		return false
	}
	a := r[1] >= 48 && r[1] <= 57
	b := r[1] >= 97 && r[1] <= 102
	return a || b
}
926606
func (v *Style) LookupColor(colorName string) (*gdk.Color, bool) {
	color_name := C.CString(colorName)
	defer cfree(color_name)
	color := new(gdk.Color)
	b := C.gtk_style_lookup_color(v.GStyle, gstring(color_name), (*C.GdkColor)(unsafe.Pointer(&color.GColor)))
	return color, gobool(b)
}
965997
func (l *Slog) Colors(b bool) *Slog {
	l = l.copy()
	l.colors = b
	l.au = aurora.NewAurora(b)
	return l
}
313104
func CheckerColor(colorA color.Color, colorB color.Color, size uint) ColorFunc {
	return func(n int, x int, y int, maxN int, maxX int, maxY int) color.Color {
		if ((uint(x)/size)+(uint(y)/size))%2 == 0 {
			return colorA
		}

		return colorB
	}
}
946816
func HasUpperCase(str string) bool {
	if IsNull(str) {
		return true
	}
	return rxHasUpperCase.MatchString(str)
}
414378
func SquareColors(light, dark color.Color) func(*encoder) {
	return func(e *encoder) {
		e.light = light
		e.dark = dark
	}
}
743908
func hasAttributes(v interface{}, a map[string]interface{}) (interface{}, error) {
	switch v.(type) {
	case []interface{}:
		// run through all entries looking one with matching attributes
		for _, vv := range v.([]interface{}) {
			if vvv, vvverr := hasAttributes(vv, a); vvverr == nil {
				return vvv, nil
			}
		}
		return nil, errors.New("no list member with matching attributes")
	case map[string]interface{}:
		// do all attribute name:value pairs match?
		nv := v.(map[string]interface{})
		for key, val := range a {
			if vv, ok := nv[key]; !ok {
				return nil, errors.New("no attribute with name: " + key[1:])
			} else if val != vv {
				return nil, errors.New("no attribute key:value pair: " + fmt.Sprintf("%s:%v", key[1:], val))
			}
		}
		// they all match; so return value associated with "#text" key.
		if vv, ok := nv["#text"]; ok {
			return vv, nil
		} else {
			// this happens when another element is value of tag rather than just a string value
			return nv, nil
		}
	}
	return nil, errors.New("no match for attributes")
}
324666
func (n *Node) flipColors() {
	// Assumes: n has two children.
	n.Color = !n.Color
	n.Left.Color = !n.Left.Color
	n.Right.Color = !n.Right.Color
}
341159
func (e *Endpoint) HasLabels(l pkgLabels.Labels) bool {
	e.UnconditionalRLock()
	defer e.RUnlock()

	return e.hasLabelsRLocked(l)
}
243735
func (re *RelateFonts) IsContainsFamilyAndStyle(family string, style int) bool {
	i := 0
	max := len(*re)
	for i < max {
		if (*re)[i].Family == family && (*re)[i].Style == style  {
			return true
		}
		i++
	}
	return false
}
173120
func (h *Hash) HasAttributes() bool {
	return h.KeyType.Type.HasAttributes() || h.ElemType.Type.HasAttributes()
}
1091482
func MustParseColour(colour string) Colour {
	parsed := ParseColour(colour)
	if !parsed.IsSet() {
		panic(fmt.Errorf("invalid colour %q", colour))
	}
	return parsed
}
708493
func (aer *AllErrorRecorder) HasErrors() bool {
	aer.mu.Lock()
	defer aer.mu.Unlock()
	return len(aer.Errors) > 0
}
974766
func hasNonWhitespace(s string) bool {
	for _, b := range s {
		switch b {
		// Encoded-words can only be separated by linear white spaces which does
		// not include vertical tabs (\v).
		case ' ', '\t', '\n', '\r':
		default:
			return true
		}
	}
	return false
}
1212007
func (writer *baseFileWriter) Colored() bool {
	writer.lock.RLock()
	defer writer.lock.RUnlock()
	return writer.colored
}