{
  "title": "ColorInfo Visual Variable",
  "type": "object",
  "$schema": "http://json-schema.org/draft-04/schema",
  "description": "The colorInfo visual variable defines how a continuous color ramp is applied to features based on the values of a numeric field attribute.",
  "properties": {
    "field": {
      "type": "string",
      "description": "Attribute field used for color rendering if no valueExpression is provided."
    },
    "legendOptions": {
      "type": "object",
      "allOf": [
        {
          "$ref": "visualVariableLegendOptions_schema.json"
        },
        {
          "properties": {
            "title": {},
            "showLegend": {}
          },
          "additionalProperties": false
        }
      ]
    },
    "normalizationField": {
      "type": "string",
      "description": "Attribute field used to normalize the data."
    },
    "stops": {
      "type": "array",
      "description": "An array of stop objects.",
      "items": {
        "type": "object",
        "$ref": "colorStop_schema.json"
      }
    },
    "type": {
      "type": "string",
      "description": "Specifies the type of visual variable.",
      "enum": [
        "colorInfo"
      ]
    },
    "valueExpression": {
      "type": "string",
      "description": "An [Arcade expression](https://developers.arcgis.com/arcade/) that computes a value in lieu of a value provided by an attribute `field`."
    },
    "valueExpressionTitle": {
      "type": "string",
      "description": "The title identifying and describing the associated [Arcade](https://developers.arcgis.com/arcade/) expression as defined in the `valueExpression` property."
    }
  },
  "required": [
    "type"
  ],
  "additionalProperties": false,
  "esriDocumentation": {
    "examples": [
      {
        "title": "colorInfo",
        "description": "Live sample web scene showing [use of the colorInfo visual variable](https://www.arcgis.com/home/webscene/viewer.html?webscene=ed2892fef34b43b8a5cc61c8ff890c6f).",
        "code": {
          "visualVariables": [
            {
              "type": "colorInfo",
              "field": "M086_07",
              "stops": [
                {
                  "value": -99,
                  "color": [
                    255,
                    252,
                    212,
                    255
                  ],
                  "label": "< -99"
                },
                {
                  "value": 705950,
                  "color": [
                    177,
                    205,
                    194,
                    255
                  ]
                },
                {
                  "value": 1411999,
                  "color": [
                    98,
                    158,
                    176,
                    255
                  ],
                  "label": "1,411,999"
                },
                {
                  "value": 2578189,
                  "color": [
                    56,
                    98,
                    122,
                    255
                  ]
                },
                {
                  "value": 3744380,
                  "color": [
                    13,
                    38,
                    68,
                    255
                  ],
                  "label": "> 3,744,380"
                }
              ]
            }
          ]
        }
      },
      {
        "title": "constant colorInfo",
        "description": "visual Variable with constant color",
        "code": {
          "visualVariables": [
            {
              "type": "colorInfo",
              "legendOptions": {
                "title": "color"
              },
              "stops": [
                {
                  "color": [
                    255,
                    0,
                    0,
                    255
                  ]
                }
              ]
            }
          ]
        }
      }
    ]
  }
}
