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

Function addTuple

src/python/PyImath/PyImathColor4.cpp:275–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273
274template <class T>
275static Color4<T>
276addTuple(Color4<T> &color, const tuple &t)
277{
278 MATH_EXC_ON;
279 if(t.attr("__len__")() == 4)
280 return Color4<T>(color.r + extract<T>(t[0]),
281 color.g + extract<T>(t[1]),
282 color.b + extract<T>(t[2]),
283 color.a + extract<T>(t[3]));
284 else
285 throw std::invalid_argument ("Color4 expects tuple of length 4");
286}
287
288template <class T>
289static Color4<T>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected