import { Meta } from '@storybook/addon-docs/blocks'

<Meta title='@dxtmisha/en/styles/color/| functions/toGradient - Convert to gradient'/>

# `toGradient`

The function wraps a color value in a `linear-gradient` function for compatibility with the `background-image` property.

**Parameters:**
- `$color: Color | String` — the color value to wrap.

**Returns:**
- `String` — a `linear-gradient(0deg, #color, #color)` string.

## Example

```scss
@use '@dxtmisha/styles';

$gradient: styles.toGradient(#ff0000); 
// linear-gradient(0deg, #ff0000, #ff0000)
```
