How to remove 3 colors of patches

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to remove 3 colors of patches

zen95
Hi,
Could you help me to remove patches with pink and red an orange color from
all patches ?
I tried make a list of this colors but it doesn't help.

 to setup1
  clear-all
  let mylist [pink red]
  ask patches [
    set pcolor one-of remove mylist base-colors
  ]
end





--
Sent from: http://netlogo-users.18673.x6.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: How to remove 3 colors of patches

Simone Gabbriellini-3
Hi,

You cannot kill patches, just change their color to black and they’ll fade away in the background.

Cheers,
Simo

Sent from my iPhone

> On Jun 12, 2018, at 18:25, zen95 [hidden email] [netlogo-users] <[hidden email]> wrote:
>
> Hi,
> Could you help me to remove patches with pink and red an orange color from
> all patches ?
> I tried make a list of this colors but it doesn't help.
>
> to setup1
>  clear-all
>  let mylist [pink red]
>  ask patches [
>    set pcolor one-of remove mylist base-colors
>  ]
> end
>
>
>
>
>
> --
> Sent from: http://netlogo-users.18673.x6.nabble.com/
>
>
> ------------------------------------
> Posted by: zen95 <[hidden email]>
> ------------------------------------
>
>
> ------------------------------------
>
> Yahoo Groups Links
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: How to remove 3 colors of patches

guerrin
In reply to this post by zen95
Try these two and choose the one you prefer

to setup-mycolors
  let mycolors remove red (remove pink base-colors)
  ask patches [set pcolor one-of mycolors]
end


to setup-mycolors
  set mycolors base-colors ; here mycolors should be declared as a global variable
  let notmycolors [red pink orange]
 foreach notmycolors [x -> set mycolors remove x mycolors]
 ask patches [set pcolor one-of mycolors]
end


Cheers


----- Mail original -----
De: "zen95 [hidden email] [netlogo-users]" <[hidden email]>
À: [hidden email]
Envoyé: Mardi 12 Juin 2018 18:25:56
Objet: [netlogo-users] How to remove 3 colors of patches

Hi,
Could you help me to remove patches with pink and red an orange color from
all patches ?
I tried make a list of this colors but it doesn't help.

 to setup1
  clear-all
  let mylist [pink red]
  ask patches [
    set pcolor one-of remove mylist base-colors
  ]
end





--
Sent from: http://netlogo-users.18673.x6.nabble.com/