@yamada-ui/utils
Advanced tools
Comparing version 0.0.0-dev-20230804221203 to 0.0.0-dev-20230813023829
import { Dict } from './index.types.js'; | ||
declare const isGray: (colorScheme: string) => boolean; | ||
declare const getColor: (color: string, fallback?: string) => (theme: Dict, colorMode: 'light' | 'dark' | undefined) => string; | ||
declare const lightenColor: (color: string, amount: number) => (theme: Dict, colorMode: 'light' | 'dark' | undefined) => string; | ||
declare const darkenColor: (color: string, amount: number) => (theme: Dict, colorMode: 'light' | 'dark' | undefined) => string; | ||
declare const tintColor: (color: string, amount: number) => (theme: Dict, colorMode: 'light' | 'dark' | undefined) => string; | ||
declare const shadeColor: (color: string, amount: number) => (theme: Dict, colorMode: 'light' | 'dark' | undefined) => string; | ||
declare const transparentizeColor: (color: string, alpha: number) => (theme: Dict, colorMode: 'light' | 'dark' | undefined) => string; | ||
declare const toneColor: (color: string, l: number) => (theme: Dict, colorMode: 'light' | 'dark' | undefined) => string; | ||
declare const getColor: (color: string, fallback?: string) => (theme: Dict, colorMode?: 'light' | 'dark') => string; | ||
declare const lightenColor: (color: string, amount: number) => (theme?: Dict, colorMode?: 'light' | 'dark') => string; | ||
declare const darkenColor: (color: string, amount: number) => (theme?: Dict, colorMode?: 'light' | 'dark') => string; | ||
declare const tintColor: (color: string, amount: number) => (theme?: Dict, colorMode?: 'light' | 'dark') => string; | ||
declare const shadeColor: (color: string, amount: number) => (theme?: Dict, colorMode?: 'light' | 'dark') => string; | ||
declare const transparentizeColor: (color: string, alpha: number) => (theme?: Dict, colorMode?: 'light' | 'dark') => string; | ||
declare const toneColor: (color: string, l: number) => (theme?: Dict, colorMode?: 'light' | 'dark') => string; | ||
declare const randomColor: ({ string, colors, }?: { | ||
@@ -15,6 +15,6 @@ string?: string | undefined; | ||
}) => string; | ||
declare const isTone: (color: string) => (theme: Dict, colorMode: 'light' | 'dark' | undefined) => "light" | "dark"; | ||
declare const isLight: (color: string) => (theme: Dict, colorMode: 'light' | 'dark' | undefined) => boolean; | ||
declare const isDark: (color: string) => (theme: Dict, colorMode: 'light' | 'dark' | undefined) => boolean; | ||
declare const isTone: (color: string) => (theme?: Dict, colorMode?: 'light' | 'dark') => "light" | "dark"; | ||
declare const isLight: (color: string) => (theme?: Dict, colorMode?: 'light' | 'dark') => boolean; | ||
declare const isDark: (color: string) => (theme?: Dict, colorMode?: 'light' | 'dark') => boolean; | ||
export { darkenColor, getColor, isDark, isGray, isLight, isTone, lightenColor, randomColor, shadeColor, tintColor, toneColor, transparentizeColor }; |
@@ -87,23 +87,23 @@ "use strict"; | ||
var lightenColor = (color, amount) => (theme, colorMode) => { | ||
const raw = getColor(color)(theme, colorMode); | ||
const raw = theme ? getColor(color)(theme, colorMode) : color; | ||
return (0, import_color2k.toHex)((0, import_color2k.lighten)(raw, amount / 100)); | ||
}; | ||
var darkenColor = (color, amount) => (theme, colorMode) => { | ||
const raw = getColor(color)(theme, colorMode); | ||
const raw = theme ? getColor(color)(theme, colorMode) : color; | ||
return (0, import_color2k.toHex)((0, import_color2k.darken)(raw, amount / 100)); | ||
}; | ||
var tintColor = (color, amount) => (theme, colorMode) => { | ||
const raw = getColor(color)(theme, colorMode); | ||
const raw = theme ? getColor(color)(theme, colorMode) : color; | ||
return (0, import_color2k.toHex)((0, import_color2k.mix)(raw, "#fff", amount)); | ||
}; | ||
var shadeColor = (color, amount) => (theme, colorMode) => { | ||
const raw = getColor(color)(theme, colorMode); | ||
const raw = theme ? getColor(color)(theme, colorMode) : color; | ||
return (0, import_color2k.toHex)((0, import_color2k.mix)(raw, "#000", amount / 100)); | ||
}; | ||
var transparentizeColor = (color, alpha) => (theme, colorMode) => { | ||
const raw = getColor(color)(theme, colorMode); | ||
const raw = theme ? getColor(color)(theme, colorMode) : color; | ||
return (0, import_color2k.transparentize)(raw, 1 - alpha); | ||
}; | ||
var toneColor = (color, l) => (theme, colorMode) => { | ||
const raw = getColor(color)(theme, colorMode); | ||
const raw = theme ? getColor(color)(theme, colorMode) : color; | ||
if (l < 0 || 900 < l) | ||
@@ -165,3 +165,3 @@ return color; | ||
var isTone = (color) => (theme, colorMode) => { | ||
const raw = getColor(color)(theme, colorMode); | ||
const raw = theme ? getColor(color)(theme, colorMode) : color; | ||
const brightness = getBrightness(raw); | ||
@@ -168,0 +168,0 @@ const isDark2 = brightness < 128; |
@@ -597,23 +597,23 @@ "use strict"; | ||
var lightenColor = (color, amount) => (theme, colorMode) => { | ||
const raw = getColor(color)(theme, colorMode); | ||
const raw = theme ? getColor(color)(theme, colorMode) : color; | ||
return (0, import_color2k.toHex)((0, import_color2k.lighten)(raw, amount / 100)); | ||
}; | ||
var darkenColor = (color, amount) => (theme, colorMode) => { | ||
const raw = getColor(color)(theme, colorMode); | ||
const raw = theme ? getColor(color)(theme, colorMode) : color; | ||
return (0, import_color2k.toHex)((0, import_color2k.darken)(raw, amount / 100)); | ||
}; | ||
var tintColor = (color, amount) => (theme, colorMode) => { | ||
const raw = getColor(color)(theme, colorMode); | ||
const raw = theme ? getColor(color)(theme, colorMode) : color; | ||
return (0, import_color2k.toHex)((0, import_color2k.mix)(raw, "#fff", amount)); | ||
}; | ||
var shadeColor = (color, amount) => (theme, colorMode) => { | ||
const raw = getColor(color)(theme, colorMode); | ||
const raw = theme ? getColor(color)(theme, colorMode) : color; | ||
return (0, import_color2k.toHex)((0, import_color2k.mix)(raw, "#000", amount / 100)); | ||
}; | ||
var transparentizeColor = (color, alpha) => (theme, colorMode) => { | ||
const raw = getColor(color)(theme, colorMode); | ||
const raw = theme ? getColor(color)(theme, colorMode) : color; | ||
return (0, import_color2k.transparentize)(raw, 1 - alpha); | ||
}; | ||
var toneColor = (color, l) => (theme, colorMode) => { | ||
const raw = getColor(color)(theme, colorMode); | ||
const raw = theme ? getColor(color)(theme, colorMode) : color; | ||
if (l < 0 || 900 < l) | ||
@@ -675,3 +675,3 @@ return color; | ||
var isTone = (color) => (theme, colorMode) => { | ||
const raw = getColor(color)(theme, colorMode); | ||
const raw = theme ? getColor(color)(theme, colorMode) : color; | ||
const brightness = getBrightness(raw); | ||
@@ -678,0 +678,0 @@ const isDark2 = brightness < 128; |
{ | ||
"name": "@yamada-ui/utils", | ||
"version": "0.0.0-dev-20230804221203", | ||
"version": "0.0.0-dev-20230813023829", | ||
"description": "Yamada UI utils", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
135931
18
39