This commit is contained in:
Chris Trevino 2022-02-09 13:09:34 -08:00
Родитель 2b3983533e
Коммит 098e7cbc43
6 изменённых файлов: 15 добавлений и 11 удалений

Просмотреть файл

@ -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/**/*"]
}