Thanks Stefan. That helps clarify some of the dtypes to me; however I still have a few confusions in regard to color data. I should have specified this more in my OP.
I am trying to create a program where all color data is stored as RGB. This requires a validator that does flexible to_rgb() conversion. I want the users to have flexibility, so it should accept names like "aqua" as well as RGB tuples. I realize now that imshow() will do its own conversions, but still don't quite understand exactly what constraints I need to impose on users for all the various use cases. For example, if a user enters a single integer (say 239), is there a de-facto way to rgb-convert this? I've tried to exhause the scenarious below; any case with question marks is still unclear to me.
INPUT TYPE INPUT EXAMPLE HANDLER DESIRED OUTPUT
-----------------------------------------------------------------------------------------------------
hex string '#0FF000' ColorConverter.to_rgb() (.2, .4, .5)
name string 'purple ' ColorConverter.to_rgb() (.1, .8, .3)
< 1 float tuple ' (.5, .2, .4) PASS (.5, .2, .4)
> 1 float/int tuple (30, 28, 90) ???? ????
int 140 (Digital channel?) (140, 140, 140)???
float 39.5 (Error??) ???
I read on wiki that a RGB tuple with elements > 1 can be interpreted as a "Digital Channel", so perhaps just leave these as is. The tough cases for me are really when a user enters a single Int or Float. Of course, I could just raise an exception if there's no de-facto way to handle this...