# components/tone (zidane-ui)

Import: `import { … } from 'zidane-ui'`. Source: [ui/src/components/tone.ts](https://github.com/Tahul/zidane/blob/main/ui/src/components/tone.ts).

## Functions

### `badgeColorStyle`

Function.

An exact icon color (`#rgb` / `#rrggbb`) as an inline style over the tone class; nothing for anything else.

```ts
function badgeColorStyle(color: unknown): CSSProperties | undefined
```

**Parameters**

- `color` (`unknown`): The color an extension named.

**Returns** `CSSProperties | undefined`

Source: [ui/src/components/tone.ts:80](https://github.com/Tahul/zidane/blob/main/ui/src/components/tone.ts#L80)

### `toneFillClass`

Function.

The fill class of a tone, for a bar or a dot. No tone, or one the kit doesn't know, is `muted`.

```ts
function toneFillClass(tone: Tone | ToneAlias | undefined): string
```

**Parameters**

- `tone` (`Tone | ToneAlias | undefined`): A tone or an alias.

**Returns** `string`

Source: [ui/src/components/tone.ts:68](https://github.com/Tahul/zidane/blob/main/ui/src/components/tone.ts#L68)

### `toneTextClass`

Function.

The text color class of a tone. No tone, or one the kit doesn't know, is `muted`.

```ts
function toneTextClass(tone: Tone | ToneAlias | undefined): string
```

**Parameters**

- `tone` (`Tone | ToneAlias | undefined`): A tone or an alias (an extension badge's `warn`).

**Returns** `string`

Source: [ui/src/components/tone.ts:59](https://github.com/Tahul/zidane/blob/main/ui/src/components/tone.ts#L59)

## Types

### `Tone`

Type.

What a color says: body text, quiet text (`muted`, `subtle`), the accent, or a status.

```ts
type Tone =
  | 'text'
  | 'muted'
  | 'subtle'
  | 'accent'
  | 'info'
  | 'success'
  | 'warning'
  | 'danger'
```

Source: [ui/src/components/tone.ts:14](https://github.com/Tahul/zidane/blob/main/ui/src/components/tone.ts#L14)

### `ToneAlias`

Type.

The other names a tone goes by: core's `warn` (extension and composer badges), `error` and a view's `default`.

```ts
type ToneAlias = 'warn' | 'error' | 'default'
```

Source: [ui/src/components/tone.ts:17](https://github.com/Tahul/zidane/blob/main/ui/src/components/tone.ts#L17)
