| 91 | |
| 92 | |
| 93 | PyObject* ITriColorFunction_Thunk::PyGetColorAt( PyObject* args ) |
| 94 | { |
| 95 | PyObject* t; |
| 96 | if( !PyArg_ParseTuple( args, "O", &t ) ) |
| 97 | return NULL; |
| 98 | |
| 99 | ITriColorPtr q; |
| 100 | q.Attach( new OTriColor ); |
| 101 | |
| 102 | if( PyLong_Check( t ) ) |
| 103 | { |
| 104 | Color tmpResult; |
| 105 | q->SetColor( GetValueAt( &tmpResult, Be::Time( PyLong_AsLongLong( t ) ) ) ); |
| 106 | } |
| 107 | else if( PyFloat_Check( t ) ) |
| 108 | { |
| 109 | Color tmpResult; |
| 110 | q->SetColor( GetValueAt( &tmpResult, PyFloat_AS_DOUBLE( t ) ) ); |
| 111 | } |
| 112 | else |
| 113 | { |
| 114 | BeOS->SetError( BEDEF, Clsid(), "arg must be of type LongLong (Be::Time) or float" ); |
| 115 | return nullptr; |
| 116 | } |
| 117 | return PyOS->WrapBlueObject( q ); |
| 118 | } |
| 119 | |
| 120 | |
| 121 | ///////////////////////////////////////////////////////////////////////////////////////// |