---
url: /api/plugins/pantoken/custom-theme-colors/src/functions/deriveScale.md
---
[pantoken-root](../../../../../index.md) / [plugins/pantoken/custom-theme-colors/src](../index.md) / deriveScale

# Function: deriveScale()

> **deriveScale**(`hex`, `curve`): [`CustomColorScale`](../interfaces/CustomColorScale.md)

Beta

Derive a full primitive scale from one hex: anchor it at the step with the nearest reference
lightness, then rebuild every step at its reference lightness with the input's hue and a chroma
scaled by the reference shape.

## Parameters

### hex

`string`

A hex color accepted by [parseHexColor](parseHexColor.md).

### curve

[`ReferenceCurve`](../interfaces/ReferenceCurve.md)

Output of buildReferenceCurve.

## Returns

[`CustomColorScale`](../interfaces/CustomColorScale.md)

The [CustomColorScale](../interfaces/CustomColorScale.md).
