github.com/coveo/gotemplate@v2.7.7+incompatible/utils/generated_colors.go (about)

     1  // Code generated by "stringer -type=Attribute -output generated_colors.go"; DO NOT EDIT.
     2  
     3  package utils
     4  
     5  import "strconv"
     6  
     7  const (
     8  	_Attribute_name_0 = "ResetBoldFaintItalicUnderlineBlinkSlowBlinkRapidReverseVideoConcealedCrossedOut"
     9  	_Attribute_name_1 = "FgBlackFgRedFgGreenFgYellowFgBlueFgMagentaFgCyanFgWhite"
    10  	_Attribute_name_2 = "BgBlackBgRedBgGreenBgYellowBgBlueBgMagentaBgCyanBgWhite"
    11  	_Attribute_name_3 = "FgHiBlackFgHiRedFgHiGreenFgHiYellowFgHiBlueFgHiMagentaFgHiCyanFgHiWhite"
    12  	_Attribute_name_4 = "BgHiBlackBgHiRedBgHiGreenBgHiYellowBgHiBlueBgHiMagentaBgHiCyanBgHiWhite"
    13  )
    14  
    15  var (
    16  	_Attribute_index_0 = [...]uint8{0, 5, 9, 14, 20, 29, 38, 48, 60, 69, 79}
    17  	_Attribute_index_1 = [...]uint8{0, 7, 12, 19, 27, 33, 42, 48, 55}
    18  	_Attribute_index_2 = [...]uint8{0, 7, 12, 19, 27, 33, 42, 48, 55}
    19  	_Attribute_index_3 = [...]uint8{0, 9, 16, 25, 35, 43, 54, 62, 71}
    20  	_Attribute_index_4 = [...]uint8{0, 9, 16, 25, 35, 43, 54, 62, 71}
    21  )
    22  
    23  func (i Attribute) String() string {
    24  	switch {
    25  	case 0 <= i && i <= 9:
    26  		return _Attribute_name_0[_Attribute_index_0[i]:_Attribute_index_0[i+1]]
    27  	case 30 <= i && i <= 37:
    28  		i -= 30
    29  		return _Attribute_name_1[_Attribute_index_1[i]:_Attribute_index_1[i+1]]
    30  	case 40 <= i && i <= 47:
    31  		i -= 40
    32  		return _Attribute_name_2[_Attribute_index_2[i]:_Attribute_index_2[i+1]]
    33  	case 90 <= i && i <= 97:
    34  		i -= 90
    35  		return _Attribute_name_3[_Attribute_index_3[i]:_Attribute_index_3[i+1]]
    36  	case 100 <= i && i <= 107:
    37  		i -= 100
    38  		return _Attribute_name_4[_Attribute_index_4[i]:_Attribute_index_4[i+1]]
    39  	default:
    40  		return "Attribute(" + strconv.FormatInt(int64(i), 10) + ")"
    41  	}
    42  }