theme-colors
Advanced tools
Comparing version 0.0.5 to 0.1.0
@@ -1,24 +0,28 @@ | ||
export declare const _variants: { | ||
50: (hex: any) => any; | ||
100: (hex: any) => any; | ||
200: (hex: any) => any; | ||
300: (hex: any) => any; | ||
400: (hex: any) => any; | ||
500: (c: any) => any; | ||
600: (hex: any) => any; | ||
700: (hex: any) => any; | ||
800: (hex: any) => any; | ||
900: (hex: any) => any; | ||
declare const _variants: { | ||
50: (hex: number[]) => number[]; | ||
100: (hex: number[]) => number[]; | ||
200: (hex: number[]) => number[]; | ||
300: (hex: number[]) => number[]; | ||
400: (hex: number[]) => number[]; | ||
500: (c: number[]) => number[]; | ||
600: (hex: number[]) => number[]; | ||
700: (hex: number[]) => number[]; | ||
800: (hex: number[]) => number[]; | ||
900: (hex: number[]) => number[]; | ||
950: (hex: number[]) => number[]; | ||
}; | ||
export declare function getColors(color: any, variants?: { | ||
50: (hex: any) => any; | ||
100: (hex: any) => any; | ||
200: (hex: any) => any; | ||
300: (hex: any) => any; | ||
400: (hex: any) => any; | ||
500: (c: any) => any; | ||
600: (hex: any) => any; | ||
700: (hex: any) => any; | ||
800: (hex: any) => any; | ||
900: (hex: any) => any; | ||
}): {}; | ||
declare function getColors(color: string, variants?: { | ||
50: (hex: number[]) => number[]; | ||
100: (hex: number[]) => number[]; | ||
200: (hex: number[]) => number[]; | ||
300: (hex: number[]) => number[]; | ||
400: (hex: number[]) => number[]; | ||
500: (c: number[]) => number[]; | ||
600: (hex: number[]) => number[]; | ||
700: (hex: number[]) => number[]; | ||
800: (hex: number[]) => number[]; | ||
900: (hex: number[]) => number[]; | ||
950: (hex: number[]) => number[]; | ||
}): Record<string, string>; | ||
export { _variants, getColors }; |
{ | ||
"name": "theme-colors", | ||
"version": "0.0.5", | ||
"description": "easily generate color shades for themes", | ||
"version": "0.1.0", | ||
"description": "Easily generate color shades for themes", | ||
"keywords": [ | ||
@@ -12,5 +12,15 @@ "theme", | ||
], | ||
"repository": "nuxt-contrib/theme-colors", | ||
"repository": "unjs/theme-colors", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"sideEffects": false, | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs" | ||
} | ||
}, | ||
"main": "dist/index.cjs", | ||
"module": "./dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
@@ -21,16 +31,23 @@ "files": [ | ||
"scripts": { | ||
"build": "tsc", | ||
"lint": "eslint --ext .ts .", | ||
"release": "yarn test && yarn build && standard-version && git push --follow-tags && npm publish", | ||
"test": "yarn lint && jest" | ||
"build": "unbuild", | ||
"dev": "vitest dev", | ||
"lint": "eslint --cache --ext .ts,.js,.mjs,.cjs . && prettier -c src test", | ||
"lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src test -w", | ||
"prepack": "pnpm run build", | ||
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags", | ||
"test": "pnpm lint && pnpm test:types && vitest run --coverage", | ||
"test:types": "tsc --noEmit --skipLibCheck" | ||
}, | ||
"devDependencies": { | ||
"@nuxtjs/eslint-config-typescript": "^3.0.0", | ||
"eslint": "^7.9.0", | ||
"jest": "^26.4.2", | ||
"standard-version": "^9.0.0", | ||
"ts-jest": "^26.4.0", | ||
"tsc": "^1.20150623.0", | ||
"typescript": "^4.0.3" | ||
"@types/node": "^20.8.9", | ||
"@vitest/coverage-v8": "^0.34.6", | ||
"changelogen": "^0.5.5", | ||
"eslint": "^8.52.0", | ||
"eslint-config-unjs": "^0.2.1", | ||
"jiti": "^1.20.0", | ||
"prettier": "^3.0.3", | ||
"typescript": "^5.2.2", | ||
"unbuild": "^2.0.0", | ||
"vitest": "^0.34.6" | ||
} | ||
} | ||
} |
# theme-colors | ||
> Easily generate color shades for themes | ||
[![npm version][npm-version-src]][npm-version-href] | ||
[![npm downloads][npm-downloads-src]][npm-downloads-href] | ||
[![bundle][bundle-src]][bundle-href] | ||
[![Codecov][codecov-src]][codecov-href] | ||
[![codecov][codecov-src]][codecov-href] | ||
[![npm version][npm-v-src]][npm-v-href] | ||
[![npm downloads][npm-dm-src]][npm-dm-href] | ||
[![package phobia][packagephobia-src]][packagephobia-href] | ||
[![bundle phobia][bundlephobia-src]][bundlephobia-href] | ||
Easily generate color shades for themes | ||
Install: | ||
## Usage | ||
```bash | ||
Install package: | ||
```sh | ||
# npm | ||
npm install theme-colors | ||
# yarn | ||
yarn add theme-colors | ||
# or | ||
# pnpm | ||
pnpm install theme-colors | ||
npm i theme-colors | ||
# bun | ||
bun install theme-colors | ||
``` | ||
Usage: | ||
Import: | ||
```js | ||
import { getColors } from 'theme-colors' | ||
// ESM | ||
import { getColors } from "theme-colors"; | ||
const theme = getColors('#ABABAB') | ||
// CommonJS | ||
const { getColors } = require("theme-colors"); | ||
// Using rgb | ||
const theme = getColors('172,172,172') | ||
const theme = getColors("#ABABAB"); | ||
// Or using RGB | ||
const theme = getColors("172,172,172"); | ||
``` | ||
This will generate the following shades: | ||
```js | ||
@@ -44,5 +56,14 @@ { | ||
900: '#333333', | ||
950: '#222222', | ||
} | ||
``` | ||
## Development | ||
- Clone this repository | ||
- Install latest LTS version of [Node.js](https://nodejs.org/en/) | ||
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` | ||
- Install dependencies using `pnpm install` | ||
- Run interactive tests using `pnpm dev` | ||
## License | ||
@@ -52,18 +73,15 @@ | ||
MIT. Made with 💖 | ||
Made with 💛 | ||
<!-- Refs --> | ||
[npm-v-src]: https://flat.badgen.net/npm/v/theme-colors/latest | ||
[npm-v-href]: https://npmjs.com/package/theme-colors | ||
Published under [MIT License](./LICENSE). | ||
[npm-dm-src]: https://flat.badgen.net/npm/dm/theme-colors | ||
[npm-dm-href]: https://npmjs.com/package/theme-colors | ||
<!-- Badges --> | ||
[packagephobia-src]: https://flat.badgen.net/packagephobia/install/theme-colors | ||
[packagephobia-href]: https://packagephobia.now.sh/result?p=theme-colors | ||
[bundlephobia-src]: https://flat.badgen.net/bundlephobia/min/theme-colors | ||
[bundlephobia-href]: https://bundlephobia.com/result?p=theme-colors | ||
[codecov-src]: https://flat.badgen.net/codecov/c/github/nuxt-contrib/theme-colors/master | ||
[codecov-href]: https://codecov.io/gh/nuxt-contrib/theme-colors | ||
[npm-version-src]: https://img.shields.io/npm/v/theme-colors?style=flat&colorA=18181B&colorB=F0DB4F | ||
[npm-version-href]: https://npmjs.com/package/theme-colors | ||
[npm-downloads-src]: https://img.shields.io/npm/dm/theme-colors?style=flat&colorA=18181B&colorB=F0DB4F | ||
[npm-downloads-href]: https://npmjs.com/package/theme-colors | ||
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/theme-colors/main?style=flat&colorA=18181B&colorB=F0DB4F | ||
[codecov-href]: https://codecov.io/gh/unjs/theme-colors | ||
[bundle-src]: https://img.shields.io/bundlephobia/minzip/theme-colors?style=flat&colorA=18181B&colorB=F0DB4F | ||
[bundle-href]: https://bundlephobia.com/result?p=theme-colors |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
10697
8
129
86
Yes
10
1