# Number Range to Color

**Source Minimum** - the smallest value within your range.

**Source Maximum** - the largest value within your range.

**Value** - connect a range of values (e.g. from a Spreadsheet)

**Gradient** - the minimum value is remapped to the color value set on the far left of your gradient, the maximum value is remapped to the color value set on the far left of your gradient.

**Clamp** - when checked, the output will never go above or below the Maximum or Minimum values.

{% hint style="info" %}
This node is also used as a base for options on the [Spreadsheet](/cavalry/nodes/utilities/spreadsheet.md) Atom. The **Value** attribute will not appear within the **Spreadsheet's** [Attribute Editor](/cavalry/user-interface/menus/window-menu/attribute-editor.md) UI as that is being driven by the data on the node itself.
{% endhint %}

{% hint style="success" %}
Example usage:

1. Create 2 [Shapes](/cavalry/nodes/shapes/basic-shape.md) (shape1 and shape2).
2. Create a **Number Range to Color**.
3. Set:
   1. **Source Minimum** = `-100`
   2. **Source Maximum** = `100`
4. Connect ***shape1.position.y > numberRangeToColor.value***
5. Connect **numberRangetoColor.id > shape2.fillColor**
6. Move **Shape1** up and down in the [Viewport](/cavalry/user-interface/menus/window-menu/viewport.md).

As **Shape1** reaches a position of **100** in the **Y** axis, **Shape2**'s **Fill Color** will be set to white (the far right of the gradient). As it moves down to a position of **-100** in **Y**, **Shape2**'s **Fill Color** will move towards black (the far left of the gradient). If **Clamp** is checked then as **Shape1** moves above **100, Shape2** will remain white.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://scenegroup.gitbook.io/cavalry/nodes/behaviours/number-range-to-color.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
