@tamagui/normalize-css-color
Advanced tools
Comparing version 1.1.11 to 1.1.12
@@ -22,2 +22,3 @@ "use strict"; | ||
default: () => src_default, | ||
names: () => import_names2.names, | ||
normalizeCSSColor: () => normalizeCSSColor, | ||
@@ -28,4 +29,8 @@ rgba: () => rgba | ||
var import_names = require("./names"); | ||
var import_names2 = require("./names"); | ||
function normalizeCSSColor(color) { | ||
let match = null; | ||
if (color in import_names.names) { | ||
return import_names.names[color]; | ||
} | ||
if (typeof color === "number") { | ||
@@ -40,5 +45,2 @@ if (color >>> 0 === color && color >= 0 && color <= 4294967295) { | ||
} | ||
if (color in import_names.names) { | ||
return import_names.names[color]; | ||
} | ||
if (match = matchers.rgb.exec(color)) { | ||
@@ -195,2 +197,3 @@ return (parse255(match[1]) << 24 | // r | ||
0 && (module.exports = { | ||
names, | ||
normalizeCSSColor, | ||
@@ -197,0 +200,0 @@ rgba |
@@ -25,5 +25,8 @@ "use strict"; | ||
const names = { | ||
transparent: 0 | ||
// keep the basics | ||
transparent: 0, | ||
white: 4294967295, | ||
black: 255 | ||
}; | ||
if (process.env.INCLUDE_CSS_COLOR_NAMES) { | ||
if (process.env.INCLUDE_CSS_COLOR_NAMES || process.env.TAMAGUI_TARGET === "native") { | ||
const allNames = require("./names.native").names; | ||
@@ -30,0 +33,0 @@ Object.assign(names, allNames); |
import { names } from "./names"; | ||
import { names as names2 } from "./names"; | ||
function normalizeCSSColor(color) { | ||
let match = null; | ||
if (color in names) { | ||
return names[color]; | ||
} | ||
if (typeof color === "number") { | ||
@@ -13,5 +17,2 @@ if (color >>> 0 === color && color >= 0 && color <= 4294967295) { | ||
} | ||
if (color in names) { | ||
return names[color]; | ||
} | ||
if (match = matchers.rgb.exec(color)) { | ||
@@ -168,2 +169,3 @@ return (parse255(match[1]) << 24 | // r | ||
src_default as default, | ||
names2 as names, | ||
normalizeCSSColor, | ||
@@ -170,0 +172,0 @@ rgba |
const names = { | ||
transparent: 0 | ||
// keep the basics | ||
transparent: 0, | ||
white: 4294967295, | ||
black: 255 | ||
}; | ||
if (process.env.INCLUDE_CSS_COLOR_NAMES) { | ||
if (process.env.INCLUDE_CSS_COLOR_NAMES || process.env.TAMAGUI_TARGET === "native") { | ||
const allNames = require("./names.native").names; | ||
@@ -6,0 +9,0 @@ Object.assign(names, allNames); |
{ | ||
"name": "@tamagui/normalize-css-color", | ||
"version": "1.1.11", | ||
"version": "1.1.12", | ||
"sideEffects": [ | ||
@@ -25,3 +25,3 @@ "*.css" | ||
"devDependencies": { | ||
"@tamagui/build": "^1.1.11" | ||
"@tamagui/build": "^1.1.12" | ||
}, | ||
@@ -28,0 +28,0 @@ "exports": { |
@@ -12,2 +12,3 @@ /* | ||
import { names } from './names' | ||
export { names } from './names' | ||
@@ -17,2 +18,6 @@ export function normalizeCSSColor(color: string): number | null { | ||
if (color in names) { | ||
return names[color] | ||
} | ||
if (typeof color === 'number') { | ||
@@ -30,6 +35,2 @@ if (color >>> 0 === color && color >= 0 && color <= 0xffffffff) { | ||
if (color in names) { | ||
return names[color] | ||
} | ||
if ((match = matchers.rgb.exec(color))) { | ||
@@ -36,0 +37,0 @@ return ( |
export const names = { | ||
// keep the basics | ||
transparent: 0x00000000, | ||
white: 0xffffffff, | ||
black: 0x000000ff, | ||
} | ||
if (process.env.INCLUDE_CSS_COLOR_NAMES) { | ||
if ( | ||
process.env.INCLUDE_CSS_COLOR_NAMES || | ||
process.env.TAMAGUI_TARGET === 'native' | ||
) { | ||
const allNames = require('./names.native').names | ||
Object.assign(names, allNames) | ||
} |
@@ -0,1 +1,2 @@ | ||
export { names } from './names'; | ||
export declare function normalizeCSSColor(color: string): number | null; | ||
@@ -2,0 +3,0 @@ export declare function rgba(colorInt: number): { |
export declare const names: { | ||
transparent: number; | ||
white: number; | ||
black: number; | ||
}; | ||
//# sourceMappingURL=names.d.ts.map |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
64388
1286
5