| 202 | |
| 203 | template <class T> |
| 204 | static Color4<T> |
| 205 | rgb2hsvTuple(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 | |
| 223 | template <class T> |