custom legend colors

18 views
Skip to first unread message

Chris Harvey

unread,
Jan 12, 2020, 12:37:53 PM1/12/20
to GAMA
Hello everyone,

I've run into what I think is an issue.  In my display, I want to have a legend of all the different colors I use.  When I created the colors, I used the custom colors palate to create colors that were appropriate for my model.  I selected different combinations of rgb values.  That worked well.  Now, I want to create a legend of those colors. To find the names of those colors, I went to the internet and used the hex value for each color.  So I have a string name and an rgb value for each color.  To make the legend I use   

map<string, rgb> salinity_values <- ["Bermuda"::127,204,197, "Picton Blue"::90,161,222]; 

This is just a subset of values from my legend, but it gives you the idea of what I'm talking about.  What is happening when I run the model, is this



note that the numerical values in the legend are the rgb values.  I cannot seem to find a way to record the custom rgb values in the legend.  Is this a bug?

Chris

Srirama Bhamidipati

unread,
Jan 12, 2020, 12:47:18 PM1/12/20
to GAMA
rgb is a kind of tuple, always inside (r,g,b)

Chris Harvey

unread,
Jan 12, 2020, 6:53:28 PM1/12/20
to GAMA
it didn't like that.  The error message I get is 'elements of salinity_value are of type rgb but are assigned elements of type contaqiner, which will be cast to rgb'.  No operator found for applying '::' to types [string, int, float]

--
You received this message because you are subscribed to a topic in the Google Groups "GAMA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gama-platform/_2YT1kQmOUY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gama-platfor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gama-platform/ecdaf9d1-1f70-4154-a0ce-138aa2d665bc%40googlegroups.com.

Huynh Quang Nghi 002628

unread,
Jan 12, 2020, 7:00:13 PM1/12/20
to gama-p...@googlegroups.com
Hi,
Sririma meant you should put the r g b value inside rgb operator:
"Bermuda"::rgb(127,204,197)
Otherwise gama cannot recognize triple int as a color.
Cheers.


You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gama-platform/CAPqE-cSbowC8VOB29W_11f-vpGG3jTBejkA8jGRdzPqZ3WWVQw%40mail.gmail.com.

Chris Harvey

unread,
Jan 12, 2020, 7:57:28 PM1/12/20
to GAMA
That worked.  I didn't realize I needed the rgb()....it made all the difference.  Thank you.

Reply all
Reply to author
Forward
0 new messages