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