Scoop API

scoop:scoop.ui.style:0.1.0

contrastThemeColors

function contrastThemeColors

source · line 10
public
public fun contrastThemeColors(pair: ColorPair, canvas: Color, minimum: Double = 7.0): ColorPair

Composite a color pair onto an opaque sRGB canvas and reach the requested contrast. Preserve a sufficient background; adjust it only when no foreground could meet the ratio. Channels must be finite and the minimum must be between 1 and 21, inclusive.