Skip to main content

adjustSaturation()

function adjustSaturation(
lightness,
baseSaturation,
isLightBase,
saturationFactor): number

Adjusts the saturation based on the lightness and whether the base color is light or dark.

Parameters

ParameterTypeDefault valueDescription
lightnessnumberundefinedThe lightness value of the color (0-100)
baseSaturationnumberundefinedThe original saturation of the base color (0-100)
isLightBasebooleanundefinedWhether the base color is considered light
saturationFactornumber0.3The factor by which to adjust the saturation (default is 0.3)

Returns

number

The adjusted saturation value (0-100)

Example

const adjustedSaturation = adjustSaturation(50, 50, true);
console.log(adjustedSaturation); // Outputs: 35

Defined in

hacks/hacks.ts:105