spinner.go
func (s *Spinner) Color(colors ...string) error {

	colorAttributes := make([]color.Attribute, len(colors))

	// Verify colours are valid and place the appropriate attribute in the array
	for index, c := range colors {
		if !validColor(c) {
			return errInvalidColor
		}

		colorAttributes[index] = colorAttributeMap[c]
	}

	s.lock.Lock()
	s.color = color.New(colorAttributes...).SprintFunc()
	s.lock.Unlock()
	s.Restart()
	return nil
}
func (s *Spinner) Color(colors ...string) error {

	colorAttributes := make([]color.Attribute, len(colors))

	// Verify colours are valid and place the appropriate attribute in the array
	for index, c := range colors {
		if !validColor(c) {
			return errInvalidColor
		}

		colorAttributes[index] = colorAttributeMap[c]
	}

	s.lock.Lock()
	s.color = color.New(colorAttributes...).SprintFunc()
	s.lock.Unlock()
	s.Restart()
	return nil
}
func ( s * Spinner ) Color ( colors ... string ) error { colorAttributes := make ( [ ] color . Attribute , len ( colors ) ) // Verify colours are valid and place the appropriate attribute in the array for index , c := range colors { if ! validColor ( c ) { return errInvalidColor } colorAttributes [ index ] = colorAttributeMap [ c ] } s . lock . Lock ( ) s . color = color . New ( colorAttributes ... ) . SprintFunc ( ) s . lock . Unlock ( ) s . Restart ( ) return nil }
// Color will set the struct field for the given color to be used
Color will set the struct field for the given color to be used