New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@asamuzakjp/css-color

Package Overview
Dependencies
Maintainers
0
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asamuzakjp/css-color - npm Package Compare versions

Comparing version 3.0.7 to 3.0.8

dist/cjs/js/css-gradient.cjs

1

dist/esm/index.d.ts

@@ -9,4 +9,5 @@ /*!

export { cssCalc } from './js/css-calc.js';
export { isGradient } from './js/css-gradient.js';
export { cssVar } from './js/css-var.js';
export { resolve } from './js/resolve.js';
export { isColor } from './js/util.js';
import { convert } from "./js/convert.js";
import { cssCalc } from "./js/css-calc.js";
import { isGradient } from "./js/css-gradient.js";
import { cssVar } from "./js/css-var.js";

@@ -11,4 +12,5 @@ import { resolve } from "./js/resolve.js";

isColor,
isGradient,
resolve
};
//# sourceMappingURL=index.js.map

9

dist/esm/js/constant.d.ts

@@ -5,3 +5,5 @@ /**

export declare const ANGLE = "deg|g?rad|turn";
export declare const LENGTH = "[cm]m|[dls]?v(?:[bhiw]|max|min)|in|p[ctx]|q|r?(?:[cl]h|cap|e[mx]|ic)";
export declare const NUM = "[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?";
export declare const NUM_POSITIVE = "\\+?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?";
export declare const NONE = "none";

@@ -20,3 +22,4 @@ export declare const PCT = "[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?%";

export declare const CS_XYZ = "xyz(?:-d(?:50|65))?";
export declare const CS_MIX = "(?:(?:ok)?lch|hsl|hwb)(?:\\s(?:(?:de|in)creasing|longer|shorter)\\shue)?|(?:ok)?lab|srgb(?:-linear)?|xyz(?:-d(?:50|65))?";
export declare const CS_RECT = "(?:ok)?lab|(?:a98|prophoto)-rgb|display-p3|rec2020|srgb(?:-linear)?|xyz(?:-d(?:50|65))?";
export declare const CS_MIX = "(?:(?:ok)?lch|hsl|hwb)(?:\\s(?:(?:de|in)creasing|longer|shorter)\\shue)?|(?:ok)?lab|(?:a98|prophoto)-rgb|display-p3|rec2020|srgb(?:-linear)?|xyz(?:-d(?:50|65))?";
export declare const FN_COLOR = "color(";

@@ -36,6 +39,6 @@ export declare const FN_MIX = "color-mix(";

export declare const SYN_MIX_PART = "(?:[a-z]+|#[\\da-f]{3}|#[\\da-f]{4}|#[\\da-f]{6}|#[\\da-f]{8}|hsla?\\(\\s*[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?(?:deg|g?rad|turn)?(?:\\s*,\\s*[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?%){2}(?:\\s*,\\s*(?:[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?|[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?%))?\\s*\\)|rgba?\\(\\s*(?:[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?(?:\\s*,\\s*[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?){2}|[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?%(?:\\s*,\\s*[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?%){2})(?:\\s*,\\s*(?:[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\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:[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?|[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?%|none)\\s+){2}(?:[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?(?:deg|g?rad|turn)?|none)(?:\\s*\\/\\s*(?:[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?|[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?%|none))?\\s*\\)|color\\(\\s*(?:(?:a98|prophoto)-rgb|display-p3|rec2020|srgb(?:-linear)?|xyz(?:-d(?:50|65))?)(?:\\s+(?:[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?|[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?%|none)){3}(?:\\s*\\/\\s*(?:[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?|[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?%|none))?\\s*\\))(?:\\s+[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?%)?";
export declare const SYN_MIX = "color-mix\\(\\s*in\\s+(?:(?:(?:ok)?lch|hsl|hwb)(?:\\s(?:(?:de|in)creasing|longer|shorter)\\shue)?|(?:ok)?lab|srgb(?:-linear)?|xyz(?:-d(?:50|65))?)\\s*,\\s*(?:[a-z]+|#[\\da-f]{3}|#[\\da-f]{4}|#[\\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%|none)\\s+){2}(?:[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?(?:deg|g?rad|turn)?|none)(?:\\s*\\/\\s*(?:[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?|[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?%|none))?\\s*\\)|color\\(\\s*(?:(?:a98|prophoto)-rgb|display-p3|rec2020|srgb(?:-linear)?|xyz(?:-d(?:50|65))?)(?:\\s+(?:[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?|[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?%|none)){3}(?:\\s*\\/\\s*(?:[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?|[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?%|none))?\\s*\\))(?:\\s+[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?%)?\\s*\\)";
export declare const SYN_MIX_CAPT = "color-mix\\(\\s*in\\s+((?:(?:ok)?lch|hsl|hwb)(?:\\s(?:(?:de|in)creasing|longer|shorter)\\shue)?|(?:ok)?lab|(?:a98|prophoto)-rgb|display-p3|rec2020|srgb(?:-linear)?|xyz(?:-d(?:50|65))?)\\s*,\\s*((?:[a-z]+|#[\\da-f]{3}|#[\\da-f]{4}|#[\\da-f]{6}|#[\\da-f]{8}|hsla?\\(\\s*[+-]?(?:(?:0|[1-9]\\d*)(?:\\.\\d*)?|\\.\\d+)(?:e-?(?:0|[1-9]\\d*))?(?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\\d*))?%)?)\\s*\\)";
export declare const VAL_COMP = "computedValue";
export declare const VAL_MIX = "mixValue";
export declare const VAL_SPEC = "specifiedValue";

@@ -11,3 +11,5 @@ const _DIGIT = "(?:0|[1-9]\\d*)";

const ANGLE = "deg|g?rad|turn";
const LENGTH = "[cm]m|[dls]?v(?:[bhiw]|max|min)|in|p[ctx]|q|r?(?:[cl]h|cap|e[mx]|ic)";
const NUM = `[+-]?(?:${_DIGIT}(?:\\.\\d*)?|\\.\\d+)(?:e-?${_DIGIT})?`;
const NUM_POSITIVE = `\\+?(?:${_DIGIT}(?:\\.\\d*)?|\\.\\d+)(?:e-?${_DIGIT})?`;
const NONE = "none";

@@ -35,3 +37,4 @@ const PCT = `${NUM}%`;

const CS_XYZ = "xyz(?:-d(?:50|65))?";
const CS_MIX = `${CS_HUE}|${CS_LAB}|${CS_SRGB}|${CS_XYZ}`;
const CS_RECT = `${CS_LAB}|${CS_RGB}|${CS_XYZ}`;
const CS_MIX = `${CS_HUE}|${CS_RECT}`;
const FN_COLOR = "color(";

@@ -63,2 +66,3 @@ const FN_MIX = "color-mix(";

CS_MIX,
CS_RECT,
CS_RGB,

@@ -72,4 +76,6 @@ CS_SRGB,

FN_VAR,
LENGTH,
NONE,
NUM,
NUM_POSITIVE,
PCT,

@@ -76,0 +82,0 @@ SYN_COLOR_TYPE,

import { NullObject, createCacheKey, getCache, CacheItem, setCache } from "./cache.js";
import { numberToHexString, convertColorToHsl, convertColorToHwb, convertColorToLab, convertColorToLch, convertColorToOklab, convertColorToOklch, convertColorToRgb, parseColorFunc, parseColorValue } from "./color.js";
import { numberToHexString, parseColorFunc, parseColorValue, convertColorToRgb, convertColorToOklch, convertColorToOklab, convertColorToLch, convertColorToLab, convertColorToHwb, convertColorToHsl } from "./color.js";
import { isString } from "./common.js";

@@ -8,3 +8,3 @@ import { cssCalc } from "./css-calc.js";

import { resolve } from "./resolve.js";
import { VAL_COMP, SYN_FN_CALC, SYN_FN_REL, SYN_FN_VAR } from "./constant.js";
import { VAL_COMP, SYN_FN_VAR, SYN_FN_REL, SYN_FN_CALC } from "./constant.js";
const NAMESPACE = "convert";

@@ -11,0 +11,0 @@ const REG_FN_CALC = new RegExp(SYN_FN_CALC);

@@ -10,8 +10,8 @@ var __typeError = (msg) => {

import { calc } from "@csstools/css-calc";
import { tokenize, TokenType } from "@csstools/css-tokenizer";
import { createCacheKey, CacheItem, getCache, setCache, NullObject } from "./cache.js";
import { TokenType, tokenize } from "@csstools/css-tokenizer";
import { createCacheKey, getCache, CacheItem, setCache, NullObject } from "./cache.js";
import { isString, isStringOrNumber } from "./common.js";
import { resolveVar } from "./css-var.js";
import { roundToPrecision } from "./util.js";
import { VAL_SPEC, SYN_FN_CALC, SYN_FN_VAR, SYN_FN_VAR_START, NUM, SYN_FN_MATH_START } from "./constant.js";
import { VAL_SPEC, SYN_FN_VAR, SYN_FN_CALC, SYN_FN_VAR_START, NUM, ANGLE, LENGTH, SYN_FN_MATH_START } from "./constant.js";
const {

@@ -35,4 +35,4 @@ CloseParen: PAREN_CLOSE,

const REG_OPERATOR = /\s[*+/-]\s/;
const REG_TYPE_DIM = new RegExp(`^(${NUM})([a-z]+)$`);
const REG_TYPE_DIM_PCT = new RegExp(`^(${NUM})([a-z]+|%)$`);
const REG_TYPE_DIM = new RegExp(`^(${NUM})(${ANGLE}|${LENGTH})$`);
const REG_TYPE_DIM_PCT = new RegExp(`^(${NUM})(${ANGLE}|${LENGTH}|%)$`);
const REG_TYPE_PCT = new RegExp(`^(${NUM})%$`);

@@ -175,8 +175,4 @@ class Calculator {

if (REG_TYPE_DIM_PCT.test(a) && REG_TYPE_DIM_PCT.test(b)) {
const [, valA = "", unitA = ""] = a.match(
REG_TYPE_DIM_PCT
);
const [, valB = "", unitB = ""] = b.match(
REG_TYPE_DIM_PCT
);
const [, valA, unitA] = a.match(REG_TYPE_DIM_PCT);
const [, valB, unitB] = b.match(REG_TYPE_DIM_PCT);
if (unitA === unitB) {

@@ -542,5 +538,3 @@ if (Number(valA) === Number(valB)) {

} else if (REG_TYPE_PCT.test(strValue)) {
const [, val = ""] = strValue.match(
REG_TYPE_PCT
);
const [, val] = strValue.match(REG_TYPE_PCT);
cal.hasPct = true;

@@ -563,5 +557,3 @@ cal.pctMul.push(MAX_PCT * MAX_PCT / Number(val));

} else if (REG_TYPE_PCT.test(strValue)) {
const [, val = ""] = strValue.match(
REG_TYPE_PCT
);
const [, val] = strValue.match(REG_TYPE_PCT);
cal.hasPct = true;

@@ -608,5 +600,3 @@ cal.pctMul.push(Number(val));

} else if (REG_TYPE_PCT.test(strValue)) {
const [, val = ""] = strValue.match(
REG_TYPE_PCT
);
const [, val] = strValue.match(REG_TYPE_PCT);
cal.hasPct = true;

@@ -629,5 +619,3 @@ cal.pctSum.push(-1 * Number(val));

} else if (REG_TYPE_PCT.test(strValue)) {
const [, val = ""] = strValue.match(
REG_TYPE_PCT
);
const [, val] = strValue.match(REG_TYPE_PCT);
cal.hasPct = true;

@@ -684,3 +672,3 @@ cal.pctSum.push(Number(val));

const items = tokenize({ css: value }).map((token) => {
const [type = "", value2 = ""] = token;
const [type, value2] = token;
let res = "";

@@ -848,3 +836,3 @@ if (type !== W_SPACE && type !== COMMENT) {

if (REG_TYPE_DIM_PCT.test(resolvedValue)) {
const [, val = "", unit = ""] = resolvedValue.match(
const [, val, unit] = resolvedValue.match(
REG_TYPE_DIM_PCT

@@ -851,0 +839,0 @@ );

@@ -1,2 +0,2 @@

import { tokenize, TokenType } from "@csstools/css-tokenizer";
import { TokenType, tokenize } from "@csstools/css-tokenizer";
import { createCacheKey, getCache, CacheItem, setCache, NullObject } from "./cache.js";

@@ -6,3 +6,3 @@ import { isString } from "./common.js";

import { isColor } from "./util.js";
import { VAL_SPEC, SYN_FN_CALC, SYN_FN_VAR, FN_VAR } from "./constant.js";
import { VAL_SPEC, SYN_FN_VAR, FN_VAR, SYN_FN_CALC } from "./constant.js";
const {

@@ -29,3 +29,3 @@ CloseParen: PAREN_CLOSE,

}
const [type = "", value = ""] = token;
const [type, value] = token;
if (type === PAREN_CLOSE) {

@@ -32,0 +32,0 @@ break;

import { CSSToken } from '@csstools/css-tokenizer';
import { NullObject } from './cache.js';
import { Options } from './typedef.js';
import { ColorChannels, Options, StringColorChannels } from './typedef.js';
/**
* @type ColorChannel - color channel
* @type NumberOrStringColorChannels - color channel
*/
type ColorChannel = (number | string)[];
type NumberOrStringColorChannels = ColorChannels & StringColorChannels;
/**
* @type StringColorChannel - color channel
*/
type StringColorChannel = string[] | NullObject;
/**
* resolve relative color channels

@@ -18,3 +14,3 @@ * @param tokens - CSS tokens

*/
export declare function resolveColorChannels(tokens: CSSToken[], opt?: Options): ColorChannel | StringColorChannel;
export declare function resolveColorChannels(tokens: CSSToken[], opt?: Options): NumberOrStringColorChannels | NullObject;
/**

@@ -21,0 +17,0 @@ * extract origin color

@@ -1,4 +0,4 @@

import { color, SyntaxFlag } from "@csstools/css-color-parser";
import { SyntaxFlag, color } from "@csstools/css-color-parser";
import { parseComponentValue } from "@csstools/css-parser-algorithms";
import { tokenize, TokenType } from "@csstools/css-tokenizer";
import { TokenType, tokenize } from "@csstools/css-tokenizer";
import { createCacheKey, getCache, CacheItem, NullObject, setCache } from "./cache.js";

@@ -10,3 +10,3 @@ import { convertColorToRgb, NAMED_COLORS } from "./color.js";

import { roundToPrecision } from "./util.js";
import { VAL_SPEC, FN_VAR, NONE, CS_LAB, CS_LCH, FN_REL, SYN_FN_VAR, SYN_COLOR_TYPE, SYN_MIX, FN_REL_CAPT, SYN_FN_MATH_START } from "./constant.js";
import { VAL_SPEC, FN_VAR, NONE, SYN_FN_VAR, FN_REL, CS_LAB, CS_LCH, FN_REL_CAPT, SYN_COLOR_TYPE, SYN_MIX, SYN_FN_MATH_START } from "./constant.js";
const {

@@ -59,9 +59,7 @@ CloseParen: PAREN_CLOSE,

const colorChannel = colorChannels.get(colorSpace);
if (!colorChannel) {
return new NullObject();
}
const mathFunc = /* @__PURE__ */ new Set();
const channels = [
[],
[],
[],
[]
];
const channels = [[], [], [], []];
let i = 0;

@@ -75,88 +73,89 @@ let nest = 0;

}
const [type = "", value = "", , , detail = {}] = token;
const { value: detailValue } = detail;
const [type, value, , , detail] = token;
const channel = channels[i];
switch (type) {
case DIM: {
const resolvedValue = resolveDimension(token, opt);
if (isString(resolvedValue)) {
channel.push(resolvedValue);
} else {
if (Array.isArray(channel)) {
switch (type) {
case DIM: {
const resolvedValue = resolveDimension(token, opt);
if (isString(resolvedValue)) {
channel.push(resolvedValue);
} else {
channel.push(value);
}
break;
}
case FUNC: {
channel.push(value);
func = true;
nest++;
if (REG_FN_MATH_START.test(value)) {
mathFunc.add(nest);
}
break;
}
break;
}
case FUNC: {
channel.push(value);
func = true;
nest++;
if (REG_FN_MATH_START.test(value)) {
mathFunc.add(nest);
case IDENT: {
if (!colorChannel.includes(value)) {
return new NullObject();
}
channel.push(value);
if (!func) {
i++;
}
break;
}
break;
}
case IDENT: {
if (!colorChannel || !colorChannel.includes(value)) {
return new NullObject();
case NUM: {
channel.push(Number(detail == null ? void 0 : detail.value));
if (!func) {
i++;
}
break;
}
channel.push(value);
if (!func) {
i++;
case PAREN_OPEN: {
channel.push(value);
nest++;
break;
}
break;
}
case NUM: {
channel.push(detailValue);
if (!func) {
i++;
case PAREN_CLOSE: {
if (func) {
const lastValue = channel[channel.length - 1];
if (lastValue === " ") {
channel.splice(-1, 1, value);
} else {
channel.push(value);
}
if (mathFunc.has(nest)) {
mathFunc.delete(nest);
}
nest--;
if (nest === 0) {
func = false;
i++;
}
}
break;
}
break;
}
case PAREN_OPEN: {
channel.push(value);
nest++;
break;
}
case PAREN_CLOSE: {
if (func) {
const lastValue = channel[channel.length - 1];
if (lastValue === " ") {
channel.splice(-1, 1, value);
} else {
channel.push(value);
}
if (mathFunc.has(nest)) {
mathFunc.delete(nest);
}
nest--;
if (nest === 0) {
func = false;
case PCT: {
channel.push(Number(detail == null ? void 0 : detail.value) / MAX_PCT);
if (!func) {
i++;
}
break;
}
break;
}
case PCT: {
channel.push(detailValue / MAX_PCT);
if (!func) {
i++;
case W_SPACE: {
if (channel.length && func) {
const lastValue = channel[channel.length - 1];
if (typeof lastValue === "number") {
channel.push(value);
} else if (isString(lastValue) && !lastValue.endsWith("(") && lastValue !== " ") {
channel.push(value);
}
}
break;
}
break;
}
case W_SPACE: {
if (channel.length && func) {
const lastValue = channel[channel.length - 1];
if (typeof lastValue === "number") {
default: {
if (type !== COMMENT && type !== EOF && func) {
channel.push(value);
} else if (isString(lastValue) && !lastValue.endsWith("(") && lastValue !== " ") {
channel.push(value);
}
}
break;
}
default: {
if (type !== COMMENT && type !== EOF && func) {
channel.push(value);
}
}
}

@@ -168,3 +167,3 @@ }

const [resolvedValue] = channel;
if (isStringOrNumber(resolvedValue) && typeof resolvedValue !== "undefined") {
if (isStringOrNumber(resolvedValue)) {
channelValues.push(resolvedValue);

@@ -219,8 +218,8 @@ }

if (REG_FN_REL_CAPT.test(value)) {
[, colorSpace = ""] = value.match(REG_FN_REL_CAPT);
[, colorSpace] = value.match(REG_FN_REL_CAPT);
}
opt.colorSpace = colorSpace;
if (REG_COLOR_CAPT.test(value)) {
const [, originColor = ""] = value.match(REG_COLOR_CAPT);
const [, restValue = ""] = value.split(originColor);
const [, originColor] = value.match(REG_COLOR_CAPT);
const [, restValue] = value.split(originColor);
if (/^[a-z]+$/.test(originColor)) {

@@ -239,6 +238,3 @@ if (!/^transparent$/.test(originColor) && !Object.prototype.hasOwnProperty.call(NAMED_COLORS, originColor)) {

const tokens = tokenize({ css: restValue });
const channelValues = resolveColorChannels(
tokens,
opt
);
const channelValues = resolveColorChannels(tokens, opt);
if (channelValues instanceof NullObject) {

@@ -248,8 +244,8 @@ setCache(cacheKey, null);

}
let channelValue;
if (channelValues.length === 3) {
const [v1, v2, v3, v4] = channelValues;
let channelValue = "";
if (isStringOrNumber(v4)) {
channelValue = ` ${v1} ${v2} ${v3} / ${v4})`;
} else {
channelValue = ` ${channelValues.join(" ")})`;
} else {
const [v1 = "", v2 = "", v3 = "", v4 = ""] = channelValues;
channelValue = ` ${v1} ${v2} ${v3} / ${v4})`;
}

@@ -261,3 +257,3 @@ if (restValue !== channelValue) {

} else {
const [, restValue = ""] = value.split(REG_FN_REL_START);
const [, restValue] = value.split(REG_FN_REL_START);
const tokens = tokenize({ css: restValue });

@@ -267,3 +263,3 @@ const originColor = [];

while (tokens.length) {
const [type = "", tokenValue = ""] = tokens.shift();
const [type, tokenValue] = tokens.shift();
switch (type) {

@@ -311,6 +307,3 @@ case FUNC:

}
const channelValues = resolveColorChannels(
tokens,
opt
);
const channelValues = resolveColorChannels(tokens, opt);
if (channelValues instanceof NullObject) {

@@ -320,8 +313,8 @@ setCache(cacheKey, null);

}
let channelValue;
if (channelValues.length === 3) {
const [v1, v2, v3, v4] = channelValues;
let channelValue = "";
if (isStringOrNumber(v4)) {
channelValue = ` ${v1} ${v2} ${v3} / ${v4})`;
} else {
channelValue = ` ${channelValues.join(" ")})`;
} else {
const [v1 = "", v2 = "", v3 = "", v4 = ""] = channelValues;
channelValue = ` ${v1} ${v2} ${v3} / ${v4})`;
}

@@ -328,0 +321,0 @@ value = value.replace(restValue, `${resolvedOriginColor}${channelValue}`);

@@ -1,2 +0,2 @@

import { createCacheKey, CacheItem, NullObject, getCache, setCache } from "./cache.js";
import { createCacheKey, getCache, CacheItem, setCache, NullObject } from "./cache.js";
import { resolveColorMix, resolveColorFunc, resolveColorValue, convertRgbToHex } from "./color.js";

@@ -7,3 +7,3 @@ import { isString } from "./common.js";

import { resolveRelativeColor } from "./relative-color.js";
import { VAL_SPEC, VAL_COMP, FN_MIX, FN_COLOR, SYN_FN_CALC, SYN_FN_REL, SYN_FN_VAR } from "./constant.js";
import { VAL_COMP, VAL_SPEC, FN_MIX, FN_COLOR, SYN_FN_VAR, SYN_FN_REL, SYN_FN_CALC } from "./constant.js";
const NAMESPACE = "resolve";

@@ -10,0 +10,0 @@ const RGB_TRANSPARENT = "rgba(0, 0, 0, 0)";

@@ -29,2 +29,21 @@ /**

/**
* @type StringColorChannels - color channels
*/
export type StringColorChannels = [
x: string,
y: string,
z: string,
alpha: string | undefined
];
/**
* @type StringColorSpaceedChannels - specified value
*/
export type StringColorSpacedChannels = [
cs: string,
x: string,
y: string,
z: string,
alpha: string | undefined
];
/**
* @type ComputedColorChannels - computed value

@@ -49,1 +68,11 @@ */

];
/**
* @type MatchedRegExp - matched regexp array
*/
export type MatchedRegExp = [
match: string,
gr1: string,
gr2: string,
gr3: string,
gr4: string
];

@@ -0,10 +1,9 @@

import { Options } from './typedef.js';
/**
* util
*/
/**
* is color
* @param value
* @param [opt]
* @returns result
*/
export declare const isColor: (value: unknown) => boolean;
export declare const isColor: (value: unknown, opt?: Options) => boolean;
/**

@@ -11,0 +10,0 @@ * value to JSON string

@@ -11,3 +11,3 @@ import { isString } from "./common.js";

const REG_MIX = new RegExp(`${SYN_MIX}`);
const isColor = (value) => {
const isColor = (value, opt = {}) => {
if (isString(value)) {

@@ -23,9 +23,9 @@ value = value.toLowerCase().trim();

} else {
const resolvedValue = resolve(value, {
format: VAL_SPEC
});
if (!opt.format) {
opt.format = VAL_SPEC;
}
const resolvedValue = resolve(value, opt);
if (resolvedValue) {
return true;
}
return false;
}

@@ -32,0 +32,0 @@ }

@@ -45,5 +45,5 @@ {

"@tanstack/config": "^0.16.1",
"@vitest/coverage-istanbul": "^3.0.4",
"esbuild": "^0.24.2",
"eslint": "^9.19.0",
"@vitest/coverage-istanbul": "^3.0.5",
"esbuild": "^0.25.0",
"eslint": "^9.20.0",
"eslint-plugin-import-x": "^4.6.1",

@@ -53,9 +53,9 @@ "eslint-plugin-regexp": "^2.7.0",

"knip": "^5.43.6",
"neostandard": "^0.12.0",
"prettier": "^3.4.2",
"publint": "^0.3.2",
"neostandard": "^0.12.1",
"prettier": "^3.5.0",
"publint": "^0.3.4",
"rimraf": "^6.0.1",
"typescript": "^5.7.3",
"vite": "^6.0.11",
"vitest": "^3.0.4"
"vite": "^6.1.0",
"vitest": "^3.0.5"
},

@@ -75,3 +75,3 @@ "scripts": {

},
"version": "3.0.7"
"version": "3.0.8"
}

@@ -10,4 +10,5 @@ /*!

export { cssCalc } from './js/css-calc';
export { isGradient } from './js/css-gradient';
export { cssVar } from './js/css-var';
export { resolve } from './js/resolve';
export { isColor } from './js/util';

@@ -16,3 +16,6 @@ /**

export const ANGLE = 'deg|g?rad|turn';
export const LENGTH =
'[cm]m|[dls]?v(?:[bhiw]|max|min)|in|p[ctx]|q|r?(?:[cl]h|cap|e[mx]|ic)';
export const NUM = `[+-]?(?:${_DIGIT}(?:\\.\\d*)?|\\.\\d+)(?:e-?${_DIGIT})?`;
export const NUM_POSITIVE = `\\+?(?:${_DIGIT}(?:\\.\\d*)?|\\.\\d+)(?:e-?${_DIGIT})?`;
export const NONE = 'none';

@@ -42,3 +45,4 @@ export const PCT = `${NUM}%`;

export const CS_XYZ = 'xyz(?:-d(?:50|65))?';
export const CS_MIX = `${CS_HUE}|${CS_LAB}|${CS_SRGB}|${CS_XYZ}`;
export const CS_RECT = `${CS_LAB}|${CS_RGB}|${CS_XYZ}`;
export const CS_MIX = `${CS_HUE}|${CS_RECT}`;
export const FN_COLOR = 'color(';

@@ -45,0 +49,0 @@ export const FN_MIX = 'color-mix(';

@@ -17,6 +17,8 @@ /**

import { roundToPrecision } from './util';
import { Options } from './typedef';
import { MatchedRegExp, Options } from './typedef';
/* constants */
import {
ANGLE,
LENGTH,
NUM,

@@ -51,4 +53,4 @@ SYN_FN_CALC,

const REG_OPERATOR = /\s[*+/-]\s/;
const REG_TYPE_DIM = new RegExp(`^(${NUM})([a-z]+)$`);
const REG_TYPE_DIM_PCT = new RegExp(`^(${NUM})([a-z]+|%)$`);
const REG_TYPE_DIM = new RegExp(`^(${NUM})(${ANGLE}|${LENGTH})$`);
const REG_TYPE_DIM_PCT = new RegExp(`^(${NUM})(${ANGLE}|${LENGTH}|%)$`);
const REG_TYPE_PCT = new RegExp(`^(${NUM})%$`);

@@ -226,8 +228,4 @@

if (REG_TYPE_DIM_PCT.test(a) && REG_TYPE_DIM_PCT.test(b)) {
const [, valA = '', unitA = ''] = a.match(
REG_TYPE_DIM_PCT
) as RegExpExecArray;
const [, valB = '', unitB = ''] = b.match(
REG_TYPE_DIM_PCT
) as RegExpExecArray;
const [, valA, unitA] = a.match(REG_TYPE_DIM_PCT) as MatchedRegExp;
const [, valB, unitB] = b.match(REG_TYPE_DIM_PCT) as MatchedRegExp;
if (unitA === unitB) {

@@ -601,5 +599,3 @@ if (Number(valA) === Number(valB)) {

} else if (REG_TYPE_PCT.test(strValue)) {
const [, val = ''] = strValue.match(
REG_TYPE_PCT
) as RegExpExecArray;
const [, val] = strValue.match(REG_TYPE_PCT) as MatchedRegExp;
cal.hasPct = true;

@@ -622,5 +618,3 @@ cal.pctMul.push((MAX_PCT * MAX_PCT) / Number(val));

} else if (REG_TYPE_PCT.test(strValue)) {
const [, val = ''] = strValue.match(
REG_TYPE_PCT
) as RegExpExecArray;
const [, val] = strValue.match(REG_TYPE_PCT) as MatchedRegExp;
cal.hasPct = true;

@@ -667,5 +661,3 @@ cal.pctMul.push(Number(val));

} else if (REG_TYPE_PCT.test(strValue)) {
const [, val = ''] = strValue.match(
REG_TYPE_PCT
) as RegExpExecArray;
const [, val] = strValue.match(REG_TYPE_PCT) as MatchedRegExp;
cal.hasPct = true;

@@ -688,5 +680,3 @@ cal.pctSum.push(-1 * Number(val));

} else if (REG_TYPE_PCT.test(strValue)) {
const [, val = ''] = strValue.match(
REG_TYPE_PCT
) as RegExpExecArray;
const [, val] = strValue.match(REG_TYPE_PCT) as MatchedRegExp;
cal.hasPct = true;

@@ -751,3 +741,3 @@ cal.pctSum.push(Number(val));

.map((token: CSSToken): string => {
const [type = '', value = ''] = token as [TokenType, string];
const [type, value] = token as [TokenType, string];
let res = '';

@@ -950,5 +940,5 @@ if (type !== W_SPACE && type !== COMMENT) {

if (REG_TYPE_DIM_PCT.test(resolvedValue)) {
const [, val = '', unit = ''] = resolvedValue.match(
const [, val, unit] = resolvedValue.match(
REG_TYPE_DIM_PCT
) as RegExpExecArray;
) as MatchedRegExp;
resolvedValue = `${roundToPrecision(Number(val), HEX)}${unit}`;

@@ -955,0 +945,0 @@ }

@@ -53,3 +53,3 @@ /**

}
const [type = '', value = ''] = token as [TokenType, string];
const [type, value] = token as [TokenType, string];
// end of var()

@@ -56,0 +56,0 @@ if (type === PAREN_CLOSE) {

@@ -23,3 +23,8 @@ /**

import { roundToPrecision } from './util';
import { ColorChannels, Options } from './typedef';
import {
ColorChannels,
MatchedRegExp,
Options,
StringColorChannels
} from './typedef';

@@ -64,11 +69,6 @@ /* constants */

/**
* @type ColorChannel - color channel
* @type NumberOrStringColorChannels - color channel
*/
type ColorChannel = (number | string)[];
type NumberOrStringColorChannels = ColorChannels & StringColorChannels;
/**
* @type StringColorChannel - color channel
*/
type StringColorChannel = string[] | NullObject;
/* regexp */

@@ -95,3 +95,3 @@ const REG_COLOR_CAPT = new RegExp(

opt: Options = {}
): ColorChannel | StringColorChannel {
): NumberOrStringColorChannels | NullObject {
if (!Array.isArray(tokens)) {

@@ -114,9 +114,13 @@ throw new TypeError(`${tokens} is not an array.`);

const colorChannel = colorChannels.get(colorSpace);
// invalid color channel
if (!colorChannel) {
return new NullObject();
}
const mathFunc = new Set();
const channels: [ColorChannel, ColorChannel, ColorChannel, ColorChannel] = [
[],
[],
[],
[]
];
const channels: [
(number | string)[],
(number | string)[],
(number | string)[],
(number | string)[]
] = [[], [], [], []];
let i = 0;

@@ -130,105 +134,107 @@ let nest = 0;

}
const [type = '', value = '', , , detail = {}] = token;
const { value: detailValue } = detail as {
value: number;
};
const channel = channels[i] as ColorChannel;
switch (type) {
case DIM: {
const resolvedValue = resolveDimension(token, opt);
if (isString(resolvedValue)) {
channel.push(resolvedValue);
} else {
const [type, value, , , detail] = token as [
TokenType,
string,
number,
number,
{ value: string | number } | undefined
];
const channel = channels[i];
if (Array.isArray(channel)) {
switch (type) {
case DIM: {
const resolvedValue = resolveDimension(token, opt);
if (isString(resolvedValue)) {
channel.push(resolvedValue);
} else {
channel.push(value);
}
break;
}
case FUNC: {
channel.push(value);
func = true;
nest++;
if (REG_FN_MATH_START.test(value)) {
mathFunc.add(nest);
}
break;
}
break;
}
case FUNC: {
channel.push(value);
func = true;
nest++;
if (REG_FN_MATH_START.test(value)) {
mathFunc.add(nest);
case IDENT: {
// invalid channel key
if (!colorChannel.includes(value)) {
return new NullObject();
}
channel.push(value);
if (!func) {
i++;
}
break;
}
break;
}
case IDENT: {
// invalid channel key
if (!colorChannel || !colorChannel.includes(value)) {
return new NullObject();
case NUM: {
channel.push(Number(detail?.value));
if (!func) {
i++;
}
break;
}
channel.push(value);
if (!func) {
i++;
case PAREN_OPEN: {
channel.push(value);
nest++;
break;
}
break;
}
case NUM: {
channel.push(detailValue);
if (!func) {
i++;
case PAREN_CLOSE: {
if (func) {
const lastValue = channel[channel.length - 1];
if (lastValue === ' ') {
channel.splice(-1, 1, value);
} else {
channel.push(value);
}
if (mathFunc.has(nest)) {
mathFunc.delete(nest);
}
nest--;
if (nest === 0) {
func = false;
i++;
}
}
break;
}
break;
}
case PAREN_OPEN: {
channel.push(value);
nest++;
break;
}
case PAREN_CLOSE: {
if (func) {
const lastValue = channel[channel.length - 1];
if (lastValue === ' ') {
channel.splice(-1, 1, value);
} else {
channel.push(value);
}
if (mathFunc.has(nest)) {
mathFunc.delete(nest);
}
nest--;
if (nest === 0) {
func = false;
case PCT: {
channel.push(Number(detail?.value) / MAX_PCT);
if (!func) {
i++;
}
break;
}
break;
}
case PCT: {
channel.push(detailValue / MAX_PCT);
if (!func) {
i++;
case W_SPACE: {
if (channel.length && func) {
const lastValue = channel[channel.length - 1];
if (typeof lastValue === 'number') {
channel.push(value);
} else if (
isString(lastValue) &&
!lastValue.endsWith('(') &&
lastValue !== ' '
) {
channel.push(value);
}
}
break;
}
break;
}
case W_SPACE: {
if (channel.length && func) {
const lastValue = channel[channel.length - 1];
if (typeof lastValue === 'number') {
default: {
if (type !== COMMENT && type !== EOF && func) {
channel.push(value);
} else if (
isString(lastValue) &&
!lastValue.endsWith('(') &&
lastValue !== ' '
) {
channel.push(value);
}
}
break;
}
default: {
if (type !== COMMENT && type !== EOF && func) {
channel.push(value);
}
}
}
}
const channelValues: ColorChannel = [];
const channelValues = [];
for (const channel of channels) {
if (channel.length === 1) {
const [resolvedValue] = channel;
if (
isStringOrNumber(resolvedValue) &&
typeof resolvedValue !== 'undefined'
) {
if (isStringOrNumber(resolvedValue)) {
channelValues.push(resolvedValue);

@@ -243,3 +249,3 @@ }

}
return channelValues;
return channelValues as NumberOrStringColorChannels;
}

@@ -294,8 +300,8 @@

if (REG_FN_REL_CAPT.test(value)) {
[, colorSpace = ''] = value.match(REG_FN_REL_CAPT) as RegExpExecArray;
[, colorSpace] = value.match(REG_FN_REL_CAPT) as MatchedRegExp;
}
opt.colorSpace = colorSpace;
if (REG_COLOR_CAPT.test(value)) {
const [, originColor = ''] = value.match(REG_COLOR_CAPT) as RegExpExecArray;
const [, restValue = ''] = value.split(originColor);
const [, originColor] = value.match(REG_COLOR_CAPT) as MatchedRegExp;
const [, restValue] = value.split(originColor) as MatchedRegExp;
if (/^[a-z]+$/.test(originColor)) {

@@ -317,6 +323,3 @@ if (

const tokens = tokenize({ css: restValue });
const channelValues = resolveColorChannels(
tokens,
opt
) as StringColorChannel;
const channelValues = resolveColorChannels(tokens, opt);
if (channelValues instanceof NullObject) {

@@ -326,8 +329,8 @@ setCache(cacheKey, null);

}
let channelValue;
if (channelValues.length === 3) {
const [v1, v2, v3, v4] = channelValues;
let channelValue = '';
if (isStringOrNumber(v4)) {
channelValue = ` ${v1} ${v2} ${v3} / ${v4})`;
} else {
channelValue = ` ${channelValues.join(' ')})`;
} else {
const [v1 = '', v2 = '', v3 = '', v4 = ''] = channelValues;
channelValue = ` ${v1} ${v2} ${v3} / ${v4})`;
}

@@ -340,3 +343,3 @@ if (restValue !== channelValue) {

} else {
const [, restValue = ''] = value.split(REG_FN_REL_START);
const [, restValue] = value.split(REG_FN_REL_START) as MatchedRegExp;
const tokens = tokenize({ css: restValue });

@@ -346,6 +349,3 @@ const originColor: string[] = [];

while (tokens.length) {
const [type = '', tokenValue = ''] = tokens.shift() as [
TokenType,
string
];
const [type, tokenValue] = tokens.shift() as [TokenType, string];
switch (type) {

@@ -397,6 +397,3 @@ case FUNC:

}
const channelValues = resolveColorChannels(
tokens,
opt
) as StringColorChannel;
const channelValues = resolveColorChannels(tokens, opt);
if (channelValues instanceof NullObject) {

@@ -406,8 +403,8 @@ setCache(cacheKey, null);

}
let channelValue: string;
if (channelValues.length === 3) {
const [v1, v2, v3, v4] = channelValues;
let channelValue = '';
if (isStringOrNumber(v4)) {
channelValue = ` ${v1} ${v2} ${v3} / ${v4})`;
} else {
channelValue = ` ${channelValues.join(' ')})`;
} else {
const [v1 = '', v2 = '', v3 = '', v4 = ''] = channelValues;
channelValue = ` ${v1} ${v2} ${v3} / ${v4})`;
}

@@ -414,0 +411,0 @@ value = value.replace(restValue, `${resolvedOriginColor}${channelValue}`);

@@ -33,2 +33,23 @@ /**

/**
* @type StringColorChannels - color channels
*/
export type StringColorChannels = [
x: string,
y: string,
z: string,
alpha: string | undefined
];
/**
* @type StringColorSpaceedChannels - specified value
*/
export type StringColorSpacedChannels = [
cs: string,
x: string,
y: string,
z: string,
alpha: string | undefined
];
/**
* @type ComputedColorChannels - computed value

@@ -54,1 +75,12 @@ */

];
/**
* @type MatchedRegExp - matched regexp array
*/
export type MatchedRegExp = [
match: string,
gr1: string,
gr2: string,
gr3: string,
gr4: string
];

@@ -7,2 +7,3 @@ /**

import { resolve } from './resolve';
import { Options } from './typedef';

@@ -26,5 +27,6 @@ /* constants */

* @param value
* @param [opt]
* @returns result
*/
export const isColor = (value: unknown): boolean => {
export const isColor = (value: unknown, opt: Options = {}): boolean => {
if (isString(value)) {

@@ -43,9 +45,9 @@ value = value.toLowerCase().trim();

} else {
const resolvedValue = resolve(value, {
format: VAL_SPEC
});
if (!opt.format) {
opt.format = VAL_SPEC;
}
const resolvedValue = resolve(value, opt);
if (resolvedValue) {
return true;
}
return false;
}

@@ -52,0 +54,0 @@ }

Sorry, the diff of this file is too big to display

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

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

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

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 too big to display

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

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc