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

Function setValueTuple

src/python/PyImath/PyImathColor4.cpp:240–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238
239template <class T>
240static void
241setValueTuple(Color4<T> &color, const tuple &t)
242{
243 MATH_EXC_ON;
244 Color4<T> v;
245 if(t.attr("__len__")() == 4)
246 {
247 v.r = extract<T>(t[0]);
248 v.g = extract<T>(t[1]);
249 v.b = extract<T>(t[2]);
250 v.a = extract<T>(t[3]);
251
252 color.setValue(v);
253 }
254 else
255 throw std::invalid_argument ("Color4 expects tuple of length 4");
256}
257
258template <class T>
259static const Color4<T> &

Callers

nothing calls this directly

Calls 1

setValueMethod · 0.80

Tested by

no test coverage detected