List of Tuples as Color Input?

Stephan's Avatar

Stephan

27 Apr, 2014 12:23 PM

I am new to Nodebox and folllowed the introductory docs. I've created a custom node that returns a python list of tuples with color values. However, I

– can't find a way to either access the tuple keys to feed the R|G|B|A channels of an RGB-Color node.
– can't use this list directly as an input for shape colors (somewhere on Github I've read that this might work, tried it with and without the alpha value included)

Is there a way to do this? If not, what other ways could you suggest?

  1. Support Staff 1 Posted by lucasnijs on 01 May, 2014 11:43 AM

    lucasnijs's Avatar

    There is probably a better way but here's a quick fix: chop of the brackets of all your tuples (e.g. with the substring node). The resulting string can be turned into numbers with the make numbers node. Here you can select the items to send to the r,g,b, and alpha ports. Look at the attached files. I used a subnetwork where you can send your list of tuples to, I just created some strings because I do not have your file.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • Bildschirmfoto_2014-04-27_um_14.17.23.png 104 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

04 Nov, 2024 10:52 AM
02 Nov, 2024 11:22 AM
01 Nov, 2024 12:41 AM
01 Oct, 2024 07:59 AM
30 Sep, 2024 11:37 PM

 

30 Sep, 2024 11:11 AM
30 Sep, 2024 02:37 AM
28 Sep, 2024 10:33 AM
26 Sep, 2024 06:41 AM
24 Sep, 2024 12:32 AM
24 Sep, 2024 12:27 AM