---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.3
alternate:
  - https://divkit.tech/docs/en/concepts/divs/2/div-linear-gradient.md
  - https://divkit.tech/docs/ru/concepts/divs/2/div-linear-gradient.md
---
> **Documentation Index:** Fetch the complete configuration index at https://divkit.tech/docs/en/llms.txt

# div-linear-gradient
Linear gradient.

## Parameters
| Parameters | Description |
| --- | --- |
| `type` | <p>**string**</p><p>Required parameter.</p><p>The value must always be `gradient`.</p> |
| `angle` | <p>**int**</p><p>Angle of gradient direction.</p><p>Restriction for the value `x`: `x >= 0 && x <= 360`.</p><p>Default value: `0`.</p> |
| `color_map` | <p>**array**</p><p>Colors and positions of gradient points. When using this parameter, the `colors` parameter is ignored.</p><p>The minimum number of elements is 2.</p><p>Available platforms: Android, iOS, web.</p> |
| `colors` | <p>**array**</p><p>Colors. Gradient points are located at an equal distance from each other.</p><p>The minimum number of elements is 2.</p> |

### color_point
| Parameters | Description |
| --- | --- |
| `color` | <p>**string**</p><p>Required parameter.</p><p>Gradient color corresponding to gradient point.</p><p>Valid formats: `#RGB`, `#ARGB`, `#RRGGBB`, `#AARRGGBB`.</p> |
| `position` | <p>**number**</p><p>Required parameter.</p><p>The position of the gradient point.</p><p>Restriction for the value `x`: `x >= 0.0 && x <= 1.0`.</p> |

<details>
<summary>JSON</summary>

```json
{
  type*: "gradient",
  angle: "int",
  color_map: [
    {
      color*: "string",
      position*: "number"
    },
    ...
  ],
  colors: [ "string", ... ]
}
```
</details>
