ant-design / ant-design-colors Goto Github PK
View Code? Open in Web Editor NEW:art: Color Palettes Calculator of Ant Design
Home Page: https://ant.design/docs/spec/colors
License: MIT License
:art: Color Palettes Calculator of Ant Design
Home Page: https://ant.design/docs/spec/colors
License: MIT License
Hi there,
Thank you for exposing this generator from antd
color spec in pure JS. I'd really like to use this in my project, and noticed that it's under MIT license in package.json
, but currently there is no license attached in this repository.
It'd be nice if you provide the MIT LICENSE
file or statement in README
so people would aware without peeking into package.json
first.
Cheers!
When I try to use grey
from this library, it outputs:
[
'#a6a6a6',
'#999999',
'#8c8c8c',
'#808080',
'#737373',
'#666666',
'#404040',
'#1a1a1a',
'#000000',
'#000000',
primary: '#666666'
]
However, the spec / documentation (https://ant.design/docs/spec/colors) indicates that grey should be:
[
'#ffffff',
'#fafafa',
'#f5f5f5',
'#e8e8e8',
'#d9d9d9',
'#bfbfbf',
'#8c8c8c',
'#595959',
'#262626',
'#000000',
]
This issue is easy enough to workaround, but I thought a fix might help out a lot of folks. Thanks!
4.1.0
to 4.2.0
.This version is covered by your current version range and after updating it in your project the build failed.
eslint-config-prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 6 commits.
5a72ee7
eslint-config-prettier v4.2.0
13cc4d2
Update dependencies
9d8c7d9
Sort TypeScript rules
1186944
chores on @typescript-eslint (#88)
1a305b4
fix(typescript): disable no-extra-parens rule
122956d
chore(typescript): update @typescript-eslint
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Hi there,
Where can I find shades for white color? What is the analog of fade(@white, 75%)
for example?
antd 5.0 已经发布,但通过这个包获取的 presetPalettes 还是 antd 4.x 的版本
The latest version 4.0.4 has the same problem as #8 again.
node_modules/@ant-design/colors/dist/src/index.d.ts:1:22 - error TS2307: Cannot find module './generate' or its corresponding type declarations.
1 import generate from './generate';
const hueStep = 2; // 色相阶梯
const saturationStep = 16; // 饱和度阶梯,浅色部分
const saturationStep2 = 5; // 饱和度阶梯,深色部分
const brightnessStep1 = 5; // 亮度阶梯,浅色部分
const brightnessStep2 = 15; // 亮度阶梯,深色部分
const lightColorCount = 5; // 浅色数量,主色上
const darkColorCount = 4; // 深色数量,主色下
24.0.1
to 24.0.2
.This version is covered by your current version range and after updating it in your project the build failed.
ts-jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
1.5.0
to 1.6.0
.This version is covered by your current version range and after updating it in your project the build failed.
@typescript-eslint/eslint-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 12 commits.
ab3c1a1
chore: publish v1.6.0
a4f95d3
feat(*): change TypeScript version range to >=3.2.1 <3.5.0 (#399)
95a948d
chore: initial pull request templates
5d81f8c
docs(eslint-plugin): fix markdown format (#394)
492b737
fix(parser): Make eslint traverse enum id (#383)
f29d1c9
fix(eslint-plugin): Fix allowExpressions
false positives in explicit-function-return-type and incorrect documentation (#388)
cebcfe6
fix(eslint-plugin): no-type-alias: fix typeof alias erroring (#380)
bf04398
fix(typescript-estree): add ExportDefaultDeclaration to union DeclarationStatement (#378)
643a223
fix(eslint-plugin): explicit-function-return-type: ensure class arrow methods are validated (#377)
6f5c0fa
docs(eslint-plugin): list rules requiring type info (#360)
ad0f2be
fix(eslint-plugin): member-naming false flagging constructors (#376)
bea6b92
feat(eslint-plugin): allow explicit variable type with arrow functions (#260)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
This line uses arrow function, which will fail on old browsers.
module
doesn't mean all language features are supported, but actually just indicates that an ES module is being exported.
这导致我长时间以为这个库里面是没有灰色的。
ant-design-colors/src/index.ts
Line 22 in abc18fd
1.6.0
to 1.7.0
.This version is covered by your current version range and after updating it in your project the build failed.
@typescript-eslint/eslint-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
as const
is reported (#390) (2521b85)The new version differs by 17 commits.
24a0d1e
chore: publish v1.7.0
9559323
chore: simplify git hooks (#445)
6c50a99
docs(eslint-plugin): ban-types: fix example syntax (#430)
eee6d49
fix(eslint-plugin): support BigInt in restrict-plus-operands rule (#344)
ba0d524
docs(eslint-plugin): Correct link to no-unused-vars (#418)
116ca75
feat(eslint-plugin): support type assertions in no-extra-parens rule (#311)
5592a2c
feat(eslint-plugin): add prefer-string-starts-ends-with rule (#289)
5311342
feat(eslint-plugin): added new rule await-promise (#192)
01c4dae
feat(eslint-plugin): add prefer-includes rule (#294)
12d47ae
docs(eslint-plugin): as const
with no-object-literal-type-assertion (#419)
3e26ab6
feat(eslint-plugin): add prefer-for-of rule (#338)
d476f15
fix(eslint-plugin): indent: fix false positive on type parameters (#385)
4b3d820
feat(eslint-plugin): [member-accessibility] add more options (#322)
2521b85
fix(eslint-plugin): no-object-literal-type-assertion: fix as const
is reported (#390)
6f77ba6
chore: add some tests and refactor tsconfig path resolution (#412)
There are 17 commits in total.
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
24.0.13
to 24.0.14
.This version is covered by your current version range and after updating it in your project the build failed.
@types/jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
2.19.0
to 2.19.1
.This version is covered by your current version range and after updating it in your project the build failed.
@typescript-eslint/eslint-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 5 commits.
1c8f0df
chore: publish v2.19.1
4c12dac
fix(typescript-estree): ts returning wrong file with project references (#1575)
e9cf734
docs(eslint-plugin): fix typo in readme
10d86b1
docs(eslint-plugin): [no-dupe-class-members] fix typo (#1566)
4670aab
fix(eslint-plugin): [unbound-method] blacklist a few unbound natives (#1562)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
1.9.0
to 1.10.0
.This version is covered by your current version range and after updating it in your project the build failed.
@typescript-eslint/eslint-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
It seems like the generate function doesn't work properly for neutral colors.
My assumption based on your color guidelines was that the generate function would also work for neutral colors but unfortunately it adds a red hue messing with the greyscale shades.
If it's too hard to refactor now, could we at least add a second parameter to the function that would try not to add any color but a palette grey shades?
hi, bundle crashes after last update
Documents\projects\sed_flexible_reports\node_modules\@ctrl\tinycolor\dist\module\conversion.js:1
import { bound01, pad2 } from './util';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at compileFunction (<anonymous>)
at wrapSafe (internal/modules/cjs/loader.js:1071:16)
at Module._compile (internal/modules/cjs/loader.js:1121:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10)
at Module.load (internal/modules/cjs/loader.js:1001:32)
at Function.Module._load (internal/modules/cjs/loader.js:900:14)
at Module.require (internal/modules/cjs/loader.js:1043:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (Documents\projects\sed_flexible_reports\node_modules\@ant-design\colors\dist\index.js:5:18)
at Module._compile (internal/modules/cjs/loader.js:1157:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10)
at Module.load (internal/modules/cjs/loader.js:1001:32)
at Function.Module._load (internal/modules/cjs/loader.js:900:14)
at Module.require (internal/modules/cjs/loader.js:1043:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (Documents\projects\sed_flexible_reports\node_modules\@ant-design\icons\lib\utils.js:22:15)
```
2.19.0
to 2.19.1
.This version is covered by your current version range and after updating it in your project the build failed.
@typescript-eslint/parser is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 5 commits.
1c8f0df
chore: publish v2.19.1
4c12dac
fix(typescript-estree): ts returning wrong file with project references (#1575)
e9cf734
docs(eslint-plugin): fix typo in readme
10d86b1
docs(eslint-plugin): [no-dupe-class-members] fix typo (#1566)
4670aab
fix(eslint-plugin): [unbound-method] blacklist a few unbound natives (#1562)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
1.17.1
to 1.18.0
.This version is covered by your current version range and after updating it in your project the build failed.
prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Try #002675
in https://ant.design/docs/spec/colors-cn#%E8%89%B2%E6%9D%BF%E7%94%9F%E6%88%90%E5%B7%A5%E5%85%B7
color-9
is outstanding here.
I found it is due to a tinycolor's feature:
Tinycolor will convert number 0-1
to 0% - 100%
https://github.com/bgrins/TinyColor/blob/96592a5cacdbf4d4d16cd7d39d4d6dd28da9bd5f/tinycolor.js#L327
And value 1
runs into 100%
right here.
We can certainly limit the value from 1 to 100 and 0. But how about use other lib like d3-hsv?
Its s
and v
are simply within 0-1
. (But no boundary check...)
1.6.0
to 1.7.0
.This version is covered by your current version range and after updating it in your project the build failed.
@typescript-eslint/parser is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
as const
is reported (#390) (2521b85)The new version differs by 17 commits.
24a0d1e
chore: publish v1.7.0
9559323
chore: simplify git hooks (#445)
6c50a99
docs(eslint-plugin): ban-types: fix example syntax (#430)
eee6d49
fix(eslint-plugin): support BigInt in restrict-plus-operands rule (#344)
ba0d524
docs(eslint-plugin): Correct link to no-unused-vars (#418)
116ca75
feat(eslint-plugin): support type assertions in no-extra-parens rule (#311)
5592a2c
feat(eslint-plugin): add prefer-string-starts-ends-with rule (#289)
5311342
feat(eslint-plugin): added new rule await-promise (#192)
01c4dae
feat(eslint-plugin): add prefer-includes rule (#294)
12d47ae
docs(eslint-plugin): as const
with no-object-literal-type-assertion (#419)
3e26ab6
feat(eslint-plugin): add prefer-for-of rule (#338)
d476f15
fix(eslint-plugin): indent: fix false positive on type parameters (#385)
4b3d820
feat(eslint-plugin): [member-accessibility] add more options (#322)
2521b85
fix(eslint-plugin): no-object-literal-type-assertion: fix as const
is reported (#390)
6f77ba6
chore: add some tests and refactor tsconfig path resolution (#412)
There are 17 commits in total.
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Hi, I'm looking for documentation related to the colour values used in Ant Design data visualization.
I know there's a colour palette for Ant Design, but I'm specifically interested in the series and colours used in Ant's G2 data visualizations. Is this the right place to ask?
generate make life good, but I don't know how to reuse the colors in less files.
"@ant-design/colors": "^7.0.0",
"@ctrl/tinycolor": "^3.6.0",
upgrade 7.0.1
"@ant-design/colors": "^7.0.1",
"@ctrl/tinycolor": "^3.6.0",
error info
PS E:\project\customer-broadcast-web-lite> npm run dev
[email protected] dev
cross-env ENV=dev vue-cli-service serve
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
INFO Starting development server...
98% after emitting CopyPlugin
ERROR Failed to compile with 2 errors 14:46:03
error in ./node_modules/@ant-design/colors/node_modules/@ctrl/tinycolor/dist/module/index.js
Module parse failed: Unexpected token (23:35)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| this.a = rgb.a;
| this.roundA = Math.round(100 * this.a) / 100;
this.format = opts.format ?? rgb.format;
| this.gradientType = opts.gradientType;
| // Don't let the range of [0,255] come back in [0,1].
@ ./node_modules/@ant-design/colors/node_modules/@ctrl/tinycolor/dist/module/public_api.js 1:0-27 1:0-27
@ ./node_modules/@ant-design/colors/es/generate.js
@ ./node_modules/@ant-design/colors/es/index.js
@ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&
@ ./src/App.vue?vue&type=script&lang=js&
@ ./src/App.vue
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.1.219:9710&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
error in ./node_modules/@ant-design/colors/node_modules/@ctrl/tinycolor/dist/module/readability.js
Module parse failed: Unexpected token (31:26)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| export function isReadable(color1, color2, wcag2 = { level: 'AA', size: 'small' }) {
| const readabilityLevel = readability(color1, color2);
switch ((wcag2.level ?? 'AA') + (wcag2.size ?? 'small')) {
| case 'AAsmall':
| case 'AAAlarge':
@ ./node_modules/@ant-design/colors/node_modules/@ctrl/tinycolor/dist/module/public_api.js 3:0-33 3:0-33
@ ./node_modules/@ant-design/colors/es/generate.js
@ ./node_modules/@ant-design/colors/es/index.js
@ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&
@ ./src/App.vue?vue&type=script&lang=js&
@ ./src/App.vue
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.1.219:9710&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
1.16.4
to 1.17.0
.This version is covered by your current version range and after updating it in your project the build failed.
prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
1.5.0
to 1.6.0
.This version is covered by your current version range and after updating it in your project the build failed.
@typescript-eslint/parser is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 12 commits.
ab3c1a1
chore: publish v1.6.0
a4f95d3
feat(*): change TypeScript version range to >=3.2.1 <3.5.0 (#399)
95a948d
chore: initial pull request templates
5d81f8c
docs(eslint-plugin): fix markdown format (#394)
492b737
fix(parser): Make eslint traverse enum id (#383)
f29d1c9
fix(eslint-plugin): Fix allowExpressions
false positives in explicit-function-return-type and incorrect documentation (#388)
cebcfe6
fix(eslint-plugin): no-type-alias: fix typeof alias erroring (#380)
bf04398
fix(typescript-estree): add ExportDefaultDeclaration to union DeclarationStatement (#378)
643a223
fix(eslint-plugin): explicit-function-return-type: ensure class arrow methods are validated (#377)
6f5c0fa
docs(eslint-plugin): list rules requiring type info (#360)
ad0f2be
fix(eslint-plugin): member-naming false flagging constructors (#376)
bea6b92
feat(eslint-plugin): allow explicit variable type with arrow functions (#260)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
I get the following error after installing this module
Module not found: Error: Can't resolve './generate' in '[...]\node_modules\@ant-design\colors\src'
In the src-folder is only a generate.ts
file, no generate.js
file. Maybe some typescript compilation problems?
1.9.0
to 1.10.0
.This version is covered by your current version range and after updating it in your project the build failed.
@typescript-eslint/parser is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.