feat: color esm
This commit is contained in:
Родитель
2b3983533e
Коммит
098e7cbc43
|
@ -25,7 +25,7 @@
|
|||
"hsluv": "^0.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@essex/scripts": "^20.0.0",
|
||||
"@essex/scripts": "^20.0.1",
|
||||
"@essex/tsconfig-base": "^1.0.0",
|
||||
"@types/chroma-js": "^2.1.3",
|
||||
"@types/node": "^14.18.5"
|
||||
|
|
|
@ -3,10 +3,13 @@
|
|||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
|
||||
import chroma, { contrast as chromaContrast } from 'chroma-js'
|
||||
import { hexToHsluv, hsluvToHex } from 'hsluv'
|
||||
import chroma from 'chroma-js'
|
||||
import hsluv from 'hsluv'
|
||||
import type { Rgb, Rgba, Hsv, Hsl } from './interfaces.js'
|
||||
|
||||
const { contrast: chromaContrast } = chroma
|
||||
const { hexToHsluv, hsluvToHex } = hsluv
|
||||
|
||||
/**
|
||||
* This is a variety of color utilities to minimize additional direct dependencies
|
||||
* that a thematic consumer might need to be aware of.
|
||||
|
|
|
@ -2,10 +2,13 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
import { hex as chromaHex } from 'chroma-js'
|
||||
import { hsluvToHex } from 'hsluv'
|
||||
import chroma from 'chroma-js'
|
||||
import hsluv from 'hsluv'
|
||||
import type { Params, Scheme } from '../interfaces'
|
||||
|
||||
const { hex: chromaHex } = chroma
|
||||
const { hsluvToHex } = hsluv
|
||||
|
||||
const lightTextLuminance = 95
|
||||
const darkTextLuminance = 20
|
||||
const lightScaleLuminance = 70
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
|
||||
import { Color } from '../Color'
|
||||
import type { Scheme } from '../interfaces'
|
||||
import { Color } from '../Color.js'
|
||||
import type { Scheme } from '../interfaces.js'
|
||||
|
||||
/**
|
||||
* Extracts a thematic Color using its scheme "path".
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
* Copyright (c) Microsoft. All rights reserved.
|
||||
* Licensed under the MIT license. See LICENSE file in the project.
|
||||
*/
|
||||
export * from './HsluvColorLogic'
|
||||
export * from './HsluvColorLogic.js'
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
{
|
||||
"extends": "@essex/tsconfig-base",
|
||||
"compilerOptions": {
|
||||
"outDir": "lib",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"skipLibCheck": true
|
||||
"outDir": "lib"
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче