---
url: /cube-functions/colordarken.md
description: Darkens a color by a given percentage.
---

# COLORDARKEN&#x20;

Darkens a color by a given percentage.

```js
COLORDARKEN(color, percentage)
```

#### Parameters

* `color` - Hex, rgb(), or rgba() value for the color to darken.
* `percentage` - Percentage to darken the color (between 1 and 0).

#### Examples

```js
COLORDARKEN("#FF0000", 0.5)
```

**Result:** `rgba(128, 0, 0, 1.0000)`

**Note:** This will return a darkened color by 50% of the original red color.
