I am trying to assign a color brewer to my turtles in 2 different boxes each time they hatch and find the mean color of the turtles in each hatch.
I could have easily done it with the pallet extension but it hasn't been updated for Netlogo 5.1 and therefore, I am using a gradient extension which uses RGB colors ([ n n n])
as input and output and as a result, I cannot find the mean of colors.
This is the related part of my code:
hatch 1
[ set generation generation + 0.1
ifelse ( tlake = "A" )
[ set color gradient:scale [ [255 0 0 ] [255 255 0] [0 0 255] ] (generation) 0 500 ]
[ set color gradient:scale [ [255 0 0 ] [255 255 0] [0 0 255] ] (generation) 500 0 ]
set AVEA mean [color] of (turtles with [tlake = "A"])
set AVEB mean [color] of (turtles with [tlake = "B"])
....
]
And this is the error I am getting:
Can't find the mean of a list that contains non-numbers : [255 0 0] is a list.
How to create a color brewer or obtain the mean value of rgb color type?