| 487 | |
| 488 | template <class T> |
| 489 | static void |
| 490 | setValueTuple(Color3<T> &color, const tuple &t) |
| 491 | { |
| 492 | MATH_EXC_ON; |
| 493 | Color3<T> v; |
| 494 | if(t.attr("__len__")() == 3) |
| 495 | { |
| 496 | v.x = extract<T>(t[0]); |
| 497 | v.y = extract<T>(t[1]); |
| 498 | v.z = extract<T>(t[2]); |
| 499 | |
| 500 | color.setValue(v); |
| 501 | } |
| 502 | else |
| 503 | throw std::invalid_argument ("Color3 expects tuple of length 3"); |
| 504 | } |
| 505 | |
| 506 | template <class T> |
| 507 | static bool |