Class: ColorKit
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:197
Constructors
new ColorKit()
new ColorKit(color): ColorKit
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:236
Parameters
Parameter | Type |
---|---|
color | undefined | string | Color | ColorKit |
Returns
Accessors
isValid
Get Signature
get isValid(): boolean
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:271
Returns
boolean
Methods
darken()
darken(amount): ColorKit
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:340
Parameters
Parameter | Type | Default value |
---|---|---|
amount | number | 10 |
Returns
getAlpha()
getAlpha(): number
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:374
Returns
number
getBrightness()
getBrightness(): number
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:368
Returns
number
getLuminance()
getLuminance(): number
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:354
Returns
number
isDark()
isDark(): boolean
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:378
Returns
boolean
isLight()
isLight(): boolean
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:382
Returns
boolean
lighten()
lighten(amount): ColorKit
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:330
Parameters
Parameter | Type | Default value |
---|---|---|
amount | number | 10 |
Returns
setAlpha()
setAlpha(value): ColorKit
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:350
Parameters
Parameter | Type |
---|---|
value | number |
Returns
toHexString()
toHexString(allowShort?): string
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:291
Parameters
Parameter | Type |
---|---|
allowShort ? | boolean |
Returns
string
toHsl()
toHsl(): IHslColor
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:326
Returns
IHslColor
toHsv()
toHsv(): IHsvColor
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:322
Returns
IHsvColor
toRgb()
toRgb(): IRgbColor
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:275
Returns
toRgbString()
toRgbString(): string
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:279
Returns
string
toString()
toString(): string
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:287
Returns
string
getContrastRatio()
static getContrastRatio(foreground, background): number
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:228
Parameters
Parameter | Type |
---|---|
foreground | string | Color | ColorKit |
background | string | Color | ColorKit |
Returns
number
mix()
static mix(
color1,
color2,
amount): ColorKit
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/color/color-kit.ts:204
Parameters
Parameter | Type |
---|---|
color1 | string | Color | ColorKit |
color2 | string | Color | ColorKit |
amount | number |