| 453 | |
| 454 | template <class T> |
| 455 | static Color3<T> |
| 456 | rgb2hsvTuple(const tuple &t) |
| 457 | { |
| 458 | MATH_EXC_ON; |
| 459 | Color3<T> color; |
| 460 | if(t.attr("__len__")() == 3) |
| 461 | { |
| 462 | color.x = extract<T>(t[0]); |
| 463 | color.y = extract<T>(t[1]); |
| 464 | color.z = extract<T>(t[2]); |
| 465 | |
| 466 | return IMATH_NAMESPACE::rgb2hsv(color); |
| 467 | } |
| 468 | else |
| 469 | throw std::invalid_argument ("Color3 expects tuple of length 3"); |
| 470 | } |
| 471 | |
| 472 | template <class T> |
| 473 | static void |