function adaptive-contrast public view code open_in_new
Returns a CSS runtime calculated relative color(black or white) for a given color.
Example
.my-component { --bg: #09f; background: var(--bg); color: adaptive-contrast(var(--bg)); // hsl(from color(from var(--bg) var(--y-contrast)) h 0 l) }Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| $color * | Color | - | The base color used in the calculation. |