AnsweredAssumed Answered

Set symbol color from RGB values in attribute table with Arcade

Question asked by rmholmesiii on Jun 13, 2018
Latest reply on Jul 16, 2018 by GabrielFM

So....

 

I have a zoning maps for all the municipality over a  tri-county area. I have taken the time to code into the attributes an RGB value and the corresponding HEX code for the appropriate color based off of the APA's Land based Classification scheme this way every R1 zone weather its in muni A or muni Z has the same color. I have around 200 unique features and i really would like to not have to copy and paste my HEX codes into the symbol color picker one at a time. 

 

this is a topic that has come up before but is not resolved satisfactorily in this thread 

Set symbol color from RGB values in attribute table 

it also is mostly for arc desktop.

 

In Pro I have the 

 

Attribute-driven color in symbology—ArcGIS Pro | ArcGIS Desktop 

 

which tells me that i must supply "Arcade expression that returns a string. "

 

all well and good and about as helpful as mud... 

 

Does the string have to be formatted as just R,G,B

Concatenate( "$feature['Units_in_M$.R'] + ", " + $feature['Units_in_M$.G'] + ", " + $feature['Units_in_M$.B'])

 

 or 

 

(R,G,B)

 

Concatenate( "(" + "$feature['Units_in_M$.R'] + ", " + $feature['Units_in_M$.G'] + ", " + $feature['Units_in_M$.B'] + ")" )

 

or

rgba(r, g, b,a)

 

Concatenate( "rgba(" + $feature['Units_in_M$.R'] + "," + $feature['Units_in_M$.G'] + "," + $feature['Units_in_M$.B'] + ",0" +")" )

 

All of these verify as correct expressions yet none of them change the color of a symbol to the correct color that I am referencing in my attribute table. 

 

I know it says that while the expression may be valid it may not symbolize correctly if the resulting text expression is not a real rgb color. I have also tried the above combinations with just hard coded (255,0,0) which should return red but it does not.

 

Also

 

As far as I can tell this may be just as time consuming as inputting the correct color by hand as there does not appear to be a way to apply this code to all 200 features. 

 

Am I missing something? 

Please help

 

 

 

Outcomes