Hi all,
I am very new to ArcGIS Pro and have a question about changing label colors based on a condition.
I am creating a map of the US where I want to display a label on each state, however, the shades of each state prevent the label from being seen if I do it all one color.
The symbology is based on a field that is a % and the symbol I want to display is that same %, by state. If the symbol is light I want the label to be black, and if the symbol is dark I want the label to be white. For some reason I cannot figure this out.
Here is the code I have based on searching online:
var r1 = $feature['T_Mapping_Renters$_.Percentage_Point_Difference_Fro'];
var output = When(r1 (>= -.005) && (<= .005), `<p style=color:rgb(255,255,255)></p>`,
r1 > .005, `<p style=color:rgb(0,0,0)></p>`,
r1 < -.005, `<p style=color:rgb(0,0,0)></p>`)
return {
type : 'text',
text : output //this property supports html tags
}
Not at all sure what lines 6-9 are doing here, and also need to transform the label into a percent:
Round($feature['T_Mapping_Renters$_.Percentage_Point_Difference_Fro']*100,0) + "%"
This is an inspiration photo as an example, would also love to know how to "pop out" the New England states that do not fit on the map"

I hope that makes sense! I would greatly appreciate the help.