Hi all,
I'm working on a Arcade expression that reads the value in the attribute table and converts the value to a name and a rgb-color code. The problem that occurs is that the symbology doesn't get changed, but within the value tab of the symbology it just produces the string.
E.g instead of displaying the color that the rgb-code represents, it has the value:
{"color":"rgb(0, 0, 0)","colorName": "Error")
I'm working with the following code:
// Define attribute column
var ValueColor = $feature.Color
// Error/default color
var DefaultColor = "rgb(0, 0, 0)";
var DefaultName = "Error";
// Define color and name
var Color;
var ColorName;
// CAD_Color_serie_10
if (ValueColor == 10) {
Color = "rgb(255, 0, 0)";
ColorName = $feature.Layer; }
else if (ValueColor == 20) {
Color = "rgb(255, 63, 0)";
ColorName = $feature.Layer; }
else if (ValueColor == 30) {
Color = "rgb(rgb(255, 127, 0)";
ColorName = $feature.Layer; }
else if (ValueColor == 40) {
Color = "rgb(255, 191, 0)";
ColorName = $feature.Layer; }
else if (ValueColor == 50) {
Color = "rgb(255, 255, 0)";
ColorName = $feature.Layer; }
else if (ValueColor == 60) {
Color = "rgb(191, 255, 0)";
ColorName = $feature.Layer; }
else if (ValueColor == 90) {
Color = "rgb(0, 255, 0)";
ColorName = $feature.Layer; }
else if (ValueColor == 130) {
Color = "rgb(0, 255, 255)";
ColorName = $feature.Layer; }
else if (ValueColor == 150) {
Color = "rgb(255, 63 , 0)";
ColorName = $feature.Layer; }
else if (ValueColor == 170) {
Color = "rgb(255, 63 , 0)";
ColorName = $feature.Layer; }
else if (ValueColor == 210) {
Color = "rgb(255, 63 , 0)";
ColorName = $feature.Layer; }
// return Error/Default color
else {
Color = DefaultColor;
ColorName = DefaultName; }
return {
"color": Color,
"colorName": ColorName
};