Jump to content
Developer Wiki and Function Reference Links ×

Colour Fill


AlanW

Recommended Posts

Could someone explain to me the coding for the fill colours please.

See file attached.

If i type in a random low number i get a colour but does not correlate to what is in the description of the node.

I can get RGB code but not a single number. Is there a chart for the colours.I understand background and foreground colours in Photoshop but how does it relate to VW? Is it related to background screen colour?

Have sort of answered my own question, the number relates to the location in the attributes pallet. Count across and down and you input that location to get the colour. But cant find the code for its location, only by counting along. Any ideas???

And I understand the fore and background, it related to the patterns.

Nothing in the node really tells you that this is what its for. Well to the programmer of VW maybe its childs play.

Without counting up on the chart to determine the location and input that number to get the colour is there something simple that I am missing??

Edited by Alan Woodwell
Link to comment

hello

The answer lies in the vector script manual in the appendix. It shows the color palette with the numbers. the same for the patterns.

It is more difficult with the Pantone ™. What I did : made a rectangle went to the color palette, change to Pantone™, fill the rectangle and export to vector script (see the screen capture) You get values for the FillBack 61680,48573,57825 in this case magenta 0521 C. You can try the other figures they work the same.

It would be easier to have in the palette those numbers as VW like RGB instead of going through all this…

Hope this helps

Link to comment

Bonjour , merci pour cela. (Google Translate)

Thank goodness for good hearted and knowledgeable people in the forum. Not sure how people are suppose to learn and use marionette to the fullest if there is very little in-depth information relating to how you use all the nodes. At least the explanation in the description of each node does not appear to be clear and I guess here is an example. I guess everyone is busy and its coming, mustn't grumble.

Well thanks again and I will have more questions as I explore Marionette.

A plus tard.

PS I wish I could speak French. Visited Paris to see the Xmas lights last year and enjoyed the parade on the Champs-Élysées and the Xmas markets.

After a bit of testing I think the codes for the colours are generated by VW because when I asked Marionette to tell me the colour codes I received the sort of reference numbers in the marionette description. See attached file.

Edited by Alan Woodwell
Link to comment

So the [0, 65535] range appears to relate to 16-bit intensity images where RGB related to 8-bit intensity images [0,255]

So it think and have tested this by using the rgb colours and multiplying each one by 257 you get the 16-bit number.

So

RGB(153,0,102) = (39321,0,26214) and you get the colour when entering it into the marionette node.

Edited by Alan Woodwell
Link to comment
  • 5 years later...

Hi @AlanW spent most of the afternoon trying to figure the RGB value and came to the same conclusion you did about it being 16-bit.

I am trying to create some classes for a project I am working on and they define the layer names, pen thickness colour etc which they provide in excel format to be imported.

Unfortunately VW cant import so was trying marionette to see if I could do it that way and create the layers as classes which I have done thanks to @DomCnode "XLS GetValues" which works nicely for extracting the relevant values from the excel file to create the class names.

What I have been trying for the last few hours is to be able to set the class "Pen" and "Fill" colors using the "Set Pen Color" and "Set Fill Color" nodes with little success 😒

 

Do you have an example of how you manages to get the RGB color values to work?

 

Link to comment
  • 10 months later...

Sorry to drag this up again.  But trying to understand a couple things:

 

1.  Re earlier posts in this thread: RGB numeric designations are comma delimited. The conversion to 16bit in @AlanW example provides a revised, but still comma delimited triplex value.  How does one enter the 3 part RGB value?  The String node?  But how enter the values? Text node into the String? A List node input to a String for every object that needs color? Or?

 

2.  Integer values for the Set Fill node can determine object fill.  The desired color value often can be picked as the number location of the color square in the vwx Classic Color chart.  Starts at zero, upper left, then counts left to right. See screen shot.  Most of the numbers seem to correlate.  Top row is all good, or at least colors are very similar to the chart squares.  But some location numbers, eg 22, 37, 95 do not return same color as that position on the chart. I did not test all the chart colors.  Many more may miss.  Any advice?

 

 

 

-B

 

image.png.83ecc59e056efb4bb800fa69d594e75b.png

Link to comment
  • 4 weeks later...

Hiya @Benson Shaw,

 

On 5/25/2022 at 10:20 PM, Benson Shaw said:

1.  Re earlier posts in this thread: RGB numeric designations are comma delimited. The conversion to 16bit in @AlanW example provides a revised, but still comma delimited triplex value.  How does one enter the 3 part RGB value?  The String node?  But how enter the values? Text node into the String? A List node input to a String for every object that needs color? Or?

RGB values are python tuple triplets. You can use an Any Node to create such input.

 

On 5/25/2022 at 10:20 PM, Benson Shaw said:

2.  Integer values for the Set Fill node can determine object fill.  The desired color value often can be picked as the number location of the color square in the vwx Classic Color chart.  Starts at zero, upper left, then counts left to right. See screen shot.  Most of the numbers seem to correlate.  Top row is all good, or at least colors are very similar to the chart squares.  But some location numbers, eg 22, 37, 95 do not return same color as that position on the chart. I did not test all the chart colors.  Many more may miss.  Any advice?

Do you know the color image on this wiki page?
https://developer.vectorworks.net/index.php/VS:Function_Reference_Appendix#colors


image.png.7877d8bd3a126afa6095fc49b01b623e.png 

  • Love 1
Link to comment

@Antonio Landsberger & @Marissa Farrell

 

Thank you for comments.  Any node seems to accept the integer numbers from the Classic Vectorworks Colors chart and return the associated color. That's good, but same as Integer node.  Color Input node is great because input is via the attributes palette color selection of the node itself.  But if the rgb values are from external source, these nodes do not offer a place for that input.

 

I don't know python, so looked up tuple.  For example, Color Chart number 247 (2nd row, pale green) rgb value is 196, 220, 196.  So should the tuple be something like 196, 220, 196   or   (196,220,196)  or  ("196","220","196") or ?

Is there a node with input port and OIP fields to accept the tuple?

What format? parentheses? commas? spaces? quotes?

 

My Mnet produces an object with color fill.  How can I assign the fill color via the rgb trio values? Current network uses the Set Fill node with input to the rgbBack port.  Other color fill assign process would be fine, too.

 

Thanks

-B

image.png.0592ee1aa4e6a855a7ae43c4f9acc627.png

 

 

 

Link to comment
  • Marionette Maven

You can place them as 

(196,220,196)

HOWEVER, these values are in the range of 0-65535, so you need to multiply the standard 256 values by 256 to get the right color in VW.

so, for example, your values would be 

(50176,56320,50176)

 

You can enter the string right into the Any node text field as the 3 values within parentheses. 

 

Also, you can technically use a point3 input node with your r, g, b values as x, y, z.

  • Like 2
Link to comment

@Marissa Farrell  Excellent! Thank you for unraveling that numeric mystery!

Also, turns out that the Any Node OIP> eval field is math capable. Keying in the individual multiplications is same as keying in the products:

(196*256),(220*256),(196*256) = (50176,56320,50176).

 

Even better, for me anyway, the background math of the Any Node OIP> eval field  leaves my 3 sets of parens intact rather than showing the products.

This means a different color can be input by amending the 1st term(s).  No need to key in the * and the 256 each time.  Yay!

 

-B

 

Edited by Benson Shaw
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...