alpha
functionSet the alpha/opacity of a color.
Import
import { alpha } from '@modular/sdk';Notes
- returns
- The color with modified alpha as rgba() string
- throws
- Error if the color format is invalid or opacity is out of range
- example
- ```ts alpha('#ff0000', 0.5) // => 'rgba(255, 0, 0, 0.5)' alpha('rgb(0, 255, 0)', 0.8) // => 'rgba(0, 255, 0, 0.8)' ```