From: Bruce P. <bap...@te...> - 2004-07-28 16:58:17
|
<<snip>>> > This error was generated because you assigned the color of a label > object to be a vector, when it wants a 3-tuple. > > If this is a serious problem for you, then I can implement a workaround > that would accept any 3-element sequence to be a color, but I don't > think it is appropriate to use vectors for specifying a color. > > In the meantime, you can use the built-in function tuple(sequence) to > construct a tuple from any sequence (Visual's vectors are sequences), or > you can use the special member function vector.as_tuple() for a faster That would be vector.astuple(), with no '_'. > conversion in performance-sensitive code. -Jonathan Thanks -- that worked -- I agree that colors are more appropriately tuples. I was using a vector difference to define complementary colors so that a label would show regardless of the background color. I forgot to translate the vector difference back to a tuple -- and the old VPython was willing to accept this. Bruce Peterson 425 466 7344 |