| 175 | |
| 176 | template <class T> |
| 177 | static Color4<T> |
| 178 | hsv2rgbTuple(const tuple &t) |
| 179 | { |
| 180 | MATH_EXC_ON; |
| 181 | Color4<T> color; |
| 182 | if(t.attr("__len__")() == 4) |
| 183 | { |
| 184 | color.r = extract<T>(t[0]); |
| 185 | color.g = extract<T>(t[1]); |
| 186 | color.b = extract<T>(t[2]); |
| 187 | color.a = extract<T>(t[3]); |
| 188 | |
| 189 | return IMATH_NAMESPACE::hsv2rgb(color); |
| 190 | } |
| 191 | else |
| 192 | throw std::invalid_argument ("Color4 expects tuple of length 4"); |
| 193 | } |
| 194 | |
| 195 | template <class T> |
| 196 | static Color4<T> |