MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / rgb2hsvTuple

Function rgb2hsvTuple

src/python/PyImath/PyImathColor4.cpp:204–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202
203template <class T>
204static Color4<T>
205rgb2hsvTuple(const tuple &t)
206{
207 MATH_EXC_ON;
208 Color4<T> color;
209 if(t.attr("__len__")() == 4)
210 {
211 color.r = extract<T>(t[0]);
212 color.g = extract<T>(t[1]);
213 color.b = extract<T>(t[2]);
214 color.a = extract<T>(t[3]);
215
216 return IMATH_NAMESPACE::rgb2hsv(color);
217 }
218 else
219 throw std::invalid_argument ("Color4 expects tuple of length 4");
220}
221
222
223template <class T>

Callers

nothing calls this directly

Calls 1

rgb2hsvFunction · 0.70

Tested by

no test coverage detected