shadeColor

shadeColor(color: any, alpha = 1): string

To ensure a more consistent user experience in native Squirrel components, all hover and highlight effects apply a set shade or tint effect. This method allows you to pass in a colour and receive the RGBA code of a colour with a 30% shade applied to it.

The method accepts the following argument

color: string

The color in either Hex or RGB

alpha: number (defaults to 1)

The alpha value for the color

Returns an RGBA string of the new colour

Last updated

Was this helpful?