Libraries‎ > ‎Library‎ > ‎Images‎ > ‎

Import patch colors (red/green/blue)

BehaviourComposer: ignore everything before this.

Begin micro-behaviour:

Begin description:

Import patch RGB colors from an image file.

End description

Import red/green/blue patch colors

Begin NetLogo code:

substitute-text-area-for image-file-name NetLogoData/yourfilehere.png
run-in-observer-context 
  task [import-pcolors-rgb "image-file-name"]

End NetLogo code

WARNING! This code will run after everything else scheduled for this time due to the need to run in the observer context. If you want to run micro-behaviours that read the imported colors they must be delayed by any amount (less than 1.0 is recommended).

When using BC2NetLogo we recommend you place images and data files in the NetLogoData folder inside of the BC2NetLogo installation folder.

Please note that for this to run in an applet the image needs to be uploaded to the server. Please send any such files to info@modelling4all.org.

BehaviourComposer: ignore everything after this.

Comments