UNPKG

chromaticity-color-utilities

Version:
271 lines (270 loc) 8.9 kB
import * as Colors from './Colors'; declare class Modify { /** * Rotate $hue by $angle degrees * Degrees can be more than 360 or less than -360 and will loop around * * @param {number} hue degrees * @param {number} angle degrees * @return {number} rotated hue */ static hueShift(hue: number, angle: number): number; /** * Darken RGB color by amount * * @param {Colors.rgb} rgb * @param {number} [amount=0.5] amount to darken, 0-1 * @return {Colors.rgb} */ static rgbDarken(rgb: Colors.rgb, amount?: number): Colors.rgb; /** * Lighten RGB color by amount * * @param {Colors.rgb} rgb * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.rgb} */ static rgbLighten(rgb: Colors.rgb, amount?: number): Colors.rgb; /** * Darken RGB color by amount (alt method) * * @param {Colors.rgb} rgb * @param {number} [amount=0.5] amount to darken, 0-1 * @return {Colors.rgb} */ static rgb2Darken(rgb: Colors.rgb, amount?: number): Colors.rgb; /** * Lighten RGB color by amount (alt method) * * @param {Colors.rgb} rgb * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.rgb} */ static rgb2Lighten(rgb: Colors.rgb, amount?: number): Colors.rgb; /** * Darken CMYK color by amount * * @param {Colors.cmyk} cmyk * @param {number} [amount=0.5] amount to darken, 0-1 * @return {Colors.cmyk} */ static cmykDarken(cmyk: Colors.cmyk, amount?: number): Colors.cmyk; /** * Lighten CMYK color by amount * * @param {Colors.cmyk} cmyk * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.cmyk} */ static cmykLighten(cmyk: Colors.cmyk, amount?: number): Colors.cmyk; /** * Darken CMYK color by amount (alt method) * * @param {Colors.cmyk} cmyk * @param {number} [amount=0.5] amount to darken, 0-1 * @return {Colors.cmyk} */ static cmyk2Darken(cmyk: Colors.cmyk, amount?: number): Colors.cmyk; /** * Lighten CMYK color by amount (alt method) * * @param {Colors.cmyk} cmyk * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.cmyk} */ static cmyk2Lighten(cmyk: Colors.cmyk, amount?: number): Colors.cmyk; /** * Darken HSL color by amount * * @param {Colors.hsl} hsl * @param {number} [amount=0.5] amount to darken, 0-1 * @return {Colors.hsl} */ static hslDarken(hsl: Colors.hsl, amount?: number): Colors.hsl; /** * Lighten HSL color by amount * * @param {Colors.hsl} hsl * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.hsl} */ static hslLighten(hsl: Colors.hsl, amount?: number): Colors.hsl; /** * Darken HSV color by amount * * @param {Colors.hsv} hsv * @param {number} [amount=0.5] amount to darken, 0-1 * @return {Colors.hsv} */ static hsvDarken(hsv: Colors.hsv, amount?: number): Colors.hsv; /** * Lighten HSV color by amount * * @param {Colors.hsv} hsv * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.hsv} */ static hsvLighten(hsv: Colors.hsv, amount?: number): Colors.hsv; /** * Darken HSI color by amount * * @param {Colors.hsi} hsi * @param {number} [amount=0.5] amount to darken, 0-1 * @return {Colors.hsi} */ static hsiDarken(hsi: Colors.hsi, amount?: number): Colors.hsi; /** * Lighten HSI color by amount * * @param {Colors.hsi} hsi * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.hsi} */ static hsiLighten(hsi: Colors.hsi, amount?: number): Colors.hsi; /** * Darken HSP color by amount * * @param {Colors.hsp} hsp * @param {number} [amount=0.5] amount to darken, 0-1 * @return {Colors.hsp} */ static hspDarken(hsp: Colors.hsp, amount?: number): Colors.hsp; /** * Lighten HSP color by amount * * @param {Colors.hsp} hsp * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.hsp} */ static hspLighten(hsp: Colors.hsp, amount?: number): Colors.hsp; /** * Darken Lab color by amount * * @param {Colors.lab} lab * @param {number} [amount=0.5] amount to darken, 0-1 * @return {Colors.lab} */ static labDarken(lab: Colors.lab, amount?: number): Colors.lab; /** * Lighten Lab color by amount * * @param {Colors.lab} lab * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.lab} */ static labLighten(lab: Colors.lab, amount?: number): Colors.lab; /** * Darken Lab color by amount (alt method) * * @param {Colors.lab} lab * @param {number} [amount=0.5] amount to darken, 0-1 * @return {Colors.lab} */ static lab2Darken(lab: Colors.lab, amount?: number): Colors.lab; /** * Lighten Lab color by amount (alt method) * * @param {Colors.lab} lab * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.lab} */ static lab2Lighten(lab: Colors.lab, amount?: number): Colors.lab; /** * Darken Luv color by amount * * @param {Colors.luv} luv * @param {number} [amount=0.5] amount to darken, 0-1 * @return {Colors.luv} */ static luvDarken(luv: Colors.luv, amount?: number): Colors.luv; /** * Lighten Luv color by amount * * @param {Colors.luv} luv * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.luv} */ static luvLighten(luv: Colors.luv, amount?: number): Colors.luv; /** * Darken Luv color by amount (alt method) * Breaks as L* approaches 0 * * @param {Colors.luv} luv * @param {number} [amount=0.5] amount to darken, 0-1 * @return {Colors.luv} */ static luv2Darken(luv: Colors.luv, amount?: number): Colors.luv; /** * Lighten Luv color by amount (alt method) * * @param {Colors.luv} luv * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.luv} */ static luv2Lighten(luv: Colors.luv, amount?: number): Colors.luv; /** * Desaturate HSL color by amount * * @param {Colors.hsl} hsl * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.hsl} */ static hslDesaturate(hsl: Colors.hsl, amount?: number): Colors.hsl; /** * Saturate HSL color by amount * * @param {Colors.hsl} hsl * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.hsl} */ static hslSaturate(hsl: Colors.hsl, amount?: number): Colors.hsl; /** * Desaturate HSV color by amount * * @param {Colors.hsv} hsv * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.hsv} */ static hsvDesaturate(hsv: Colors.hsv, amount?: number): Colors.hsv; /** * Saturate HSV color by amount * * @param {Colors.hsv} hsv * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.hsv} */ static hsvSaturate(hsv: Colors.hsv, amount?: number): Colors.hsv; /** * Desaturate HSI color by amount * * @param {Colors.hsi} hsi * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.hsi} */ static hsiDesaturate(hsi: Colors.hsi, amount?: number): Colors.hsi; /** * Saturate HSI color by amount * * @param {Colors.hsi} hsi * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.hsi} */ static hsiSaturate(hsi: Colors.hsi, amount?: number): Colors.hsi; /** * Desaturate HSP color by amount * * @param {Colors.hsp} hsp * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.hsp} */ static hspDesaturate(hsp: Colors.hsp, amount?: number): Colors.hsp; /** * Saturate HSP color by amount * * @param {Colors.hsp} hsp * @param {number} [amount=0.5] amount to lighten, 0-1 * @return {Colors.hsp} */ static hspSaturate(hsp: Colors.hsp, amount?: number): Colors.hsp; } export default Modify;