-
Notifications
You must be signed in to change notification settings - Fork 3
/
enumgen.go
93 lines (63 loc) · 4.07 KB
/
enumgen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// Code generated by "core generate -add-types"; DO NOT EDIT.
package colorspace
import (
"cogentcore.org/core/enums"
)
var _LMSComponentsValues = []LMSComponents{0, 1, 2, 3, 4, 5, 6}
// LMSComponentsN is the highest valid value for type LMSComponents, plus one.
const LMSComponentsN LMSComponents = 7
var _LMSComponentsValueMap = map[string]LMSComponents{`LC`: 0, `MC`: 1, `SC`: 2, `LMC`: 3, `LvMC`: 4, `SvLMC`: 5, `GREY`: 6}
var _LMSComponentsDescMap = map[LMSComponents]string{0: `Long wavelength = Red component`, 1: `Medium wavelength = Green component`, 2: `Short wavelength = Blue component`, 3: `Long + Medium wavelength = Yellow component`, 4: `L - M opponent contrast: Red vs. Green`, 5: `S - L+M opponent contrast: Blue vs. Yellow`, 6: `achromatic response (grey scale lightness)`}
var _LMSComponentsMap = map[LMSComponents]string{0: `LC`, 1: `MC`, 2: `SC`, 3: `LMC`, 4: `LvMC`, 5: `SvLMC`, 6: `GREY`}
// String returns the string representation of this LMSComponents value.
func (i LMSComponents) String() string { return enums.String(i, _LMSComponentsMap) }
// SetString sets the LMSComponents value from its string representation,
// and returns an error if the string is invalid.
func (i *LMSComponents) SetString(s string) error {
return enums.SetString(i, s, _LMSComponentsValueMap, "LMSComponents")
}
// Int64 returns the LMSComponents value as an int64.
func (i LMSComponents) Int64() int64 { return int64(i) }
// SetInt64 sets the LMSComponents value from an int64.
func (i *LMSComponents) SetInt64(in int64) { *i = LMSComponents(in) }
// Desc returns the description of the LMSComponents value.
func (i LMSComponents) Desc() string { return enums.Desc(i, _LMSComponentsDescMap) }
// LMSComponentsValues returns all possible values for the type LMSComponents.
func LMSComponentsValues() []LMSComponents { return _LMSComponentsValues }
// Values returns all possible values for the type LMSComponents.
func (i LMSComponents) Values() []enums.Enum { return enums.Values(_LMSComponentsValues) }
// MarshalText implements the [encoding.TextMarshaler] interface.
func (i LMSComponents) MarshalText() ([]byte, error) { return []byte(i.String()), nil }
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
func (i *LMSComponents) UnmarshalText(text []byte) error {
return enums.UnmarshalText(i, text, "LMSComponents")
}
var _OpponentsValues = []Opponents{0, 1, 2}
// OpponentsN is the highest valid value for type Opponents, plus one.
const OpponentsN Opponents = 3
var _OpponentsValueMap = map[string]Opponents{`WhiteBlack`: 0, `RedGreen`: 1, `BlueYellow`: 2}
var _OpponentsDescMap = map[Opponents]string{0: `White vs. Black greyscale`, 1: `Red vs. Green`, 2: `Blue vs. Yellow`}
var _OpponentsMap = map[Opponents]string{0: `WhiteBlack`, 1: `RedGreen`, 2: `BlueYellow`}
// String returns the string representation of this Opponents value.
func (i Opponents) String() string { return enums.String(i, _OpponentsMap) }
// SetString sets the Opponents value from its string representation,
// and returns an error if the string is invalid.
func (i *Opponents) SetString(s string) error {
return enums.SetString(i, s, _OpponentsValueMap, "Opponents")
}
// Int64 returns the Opponents value as an int64.
func (i Opponents) Int64() int64 { return int64(i) }
// SetInt64 sets the Opponents value from an int64.
func (i *Opponents) SetInt64(in int64) { *i = Opponents(in) }
// Desc returns the description of the Opponents value.
func (i Opponents) Desc() string { return enums.Desc(i, _OpponentsDescMap) }
// OpponentsValues returns all possible values for the type Opponents.
func OpponentsValues() []Opponents { return _OpponentsValues }
// Values returns all possible values for the type Opponents.
func (i Opponents) Values() []enums.Enum { return enums.Values(_OpponentsValues) }
// MarshalText implements the [encoding.TextMarshaler] interface.
func (i Opponents) MarshalText() ([]byte, error) { return []byte(i.String()), nil }
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
func (i *Opponents) UnmarshalText(text []byte) error {
return enums.UnmarshalText(i, text, "Opponents")
}