Color Values in Python?
|
04-21-2021, 07:23 AM
Post: #3
|
|||
|
|||
RE: Color Values in Python?
Hello,
Honestly, the best way is to hard code the colors. create yourself a const variable that has the colors that you want. This will be the fastest... Else, define rgb as def rgb(r,g,b): return 65536*r + 256*g + b; Please do NOT call hpprime primitives for such things, the performance hit will be enormous... Understand that calling hpprime.eval as suggested means transforming integers to a string, concactenating strings (lots of memory moves and the like), then passing all that to the prime system (meaning switching from UTF8 to wchars), followed by parsing of the string, evaluation, and finally an analysis of the result to transform it back to python structures! I know that prime allows easy use and switch between PPL, cas and python, but these should be used sparingly, only when absolutely nessecary, with large swats in an language or another, but small, repeted calles from one realm to the others are not a good idea. They will be, at best slow, at worse highlighting bugs and causing problems... Cyrille Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Color Values in Python? - toml_12953 - 04-21-2021, 12:23 AM
RE: Color Values in Python? - critor - 04-21-2021, 07:01 AM
RE: Color Values in Python? - cyrille de brébisson - 04-21-2021 07:23 AM
RE: Color Values in Python? - toml_12953 - 04-21-2021, 07:49 AM
RE: Color Values in Python? - critor - 04-21-2021, 09:03 AM
RE: Color Values in Python? - toml_12953 - 04-21-2021, 02:23 PM
RE: Color Values in Python? - cyrille de brébisson - 04-22-2021, 08:41 AM
RE: Color Values in Python? - toml_12953 - 04-22-2021, 01:26 PM
|
User(s) browsing this thread: 1 Guest(s)