MCPcopy Create free account
hub / github.com/OpenTalker/StyleHEAT / makeColorwheel

Function makeColorwheel

utils/flow_util.py:93–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91
92
93def makeColorwheel():
94 # color encoding scheme
95
96 # adapted from the color circle idea described at
97 # http://members.shaw.ca/quadibloc/other/colint.htm
98
99 RY = 15
100 YG = 6
101 GC = 4
102 CB = 11
103 BM = 13
104 MR = 6
105
106 ncols = RY + YG + GC + CB + BM + MR
107
108 colorwheel = np.zeros([ncols, 3]) # r g b
109
110 col = 0
111 # RY
112 colorwheel[0:RY, 0] = 255
113 colorwheel[0:RY, 1] = np.floor(255 * np.arange(0, RY, 1) / RY)
114 col += RY
115
116 # YG
117 colorwheel[col:YG + col, 0] = 255 - np.floor(255 * np.arange(0, YG, 1) / YG)
118 colorwheel[col:YG + col, 1] = 255
119 col += YG
120
121 # GC
122 colorwheel[col:GC + col, 1] = 255
123 colorwheel[col:GC + col, 2] = np.floor(255 * np.arange(0, GC, 1) / GC)
124 col += GC
125
126 # CB
127 colorwheel[col:CB + col, 1] = 255 - np.floor(255 * np.arange(0, CB, 1) / CB)
128 colorwheel[col:CB + col, 2] = 255
129 col += CB
130
131 # BM
132 colorwheel[col:BM + col, 2] = 255
133 colorwheel[col:BM + col, 0] = np.floor(255 * np.arange(0, BM, 1) / BM)
134 col += BM
135
136 # MR
137 colorwheel[col:MR + col, 2] = 255 - np.floor(255 * np.arange(0, MR, 1) / MR)
138 colorwheel[col:MR + col, 0] = 255
139 return colorwheel
140
141
142def computeColor(u, v):

Callers 1

computeColorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected