Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1
A array with color name -> decimal rgbs.
License
NotificationsYou must be signed in to change notification settings
jaywcjlove/colors-named-decimal
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A array with color name -> decimal rgbs. Based onhttps://www.w3.org/TR/css-color-4/#colors-named
This package isESM only: Node 12+ is needed to use it and it must be import instead of require.
npm install colors-named-decimal
If you still want to use in CommonJS, you can use dynamicimport() to load.
constnamed=awaitimport('colors-named-decimal');// Fix compiling in typescript.// https://github.com/microsoft/TypeScript/issues/43329#issuecomment-922544562constnamed=await(Function('return import("colors-named-decimal")')())asPromise<typeofimport("colors-named-decimal")>;
importdecimalfrom"colors-named-decimal";console.log(decimal)// =====>// [// [240, 248, 255],// [250, 235, 215],// [0, 255, 255],// [127, 255, 212],// [240, 255, 255],// [245, 245, 220],// [255, 228, 196],// ...// ]console.log(decimal.length)// => 148
'colors-named''colors-named-hex''colors-named-decimal'=======================================================constnamed=[consthexs=[consthexs=['aliceblue',->'#F0F8FF',->[240,248,255],'antiquewhite',->'#FAEBD7',->[250,235,215],'aqua',->'#00FFFF',->[0,255,255],'aquamarine',->'#7FFFD4',->[127,255,212],'azure',->'#F0FFFF',->[240,255,255],'beige',->'#F5F5DC',->[245,245,220],'bisque',->'#FFE4C4',->[255,228,196],'black',->'#000000',->[0,0,0],'blanchedalmond',->'#FFEBCD',->[255,235,205],'blue',->'#0000FF',->[0,0,255],'blueviolet',->'#8A2BE2',->[138,43,226],'brown',->'#A52A2A',->[165,42,42], ...-> ...-> ...];];];
importhexsfrom"colors-named-hex";importnamedfrom"colors-named";importdecimalfrom"colors-named-decimal";decimal[named.indexOf('aliceblue')]// => [240, 248, 255]decimal[named.indexOf('red')]// => [255, 0, 0]decimal[named.indexOf('black')]// => [0, 0, 0]hexs[named.indexOf('aliceblue')]// => #F0F8FFhexs[named.indexOf('red')]// => #FF0000hexs[named.indexOf('black')]// => #000000
/** * A array with color name -> decimal rgbs. Based on https://www.w3.org/TR/css-color-4/#colors-named */declareconstdecimal:number[][];exportdefaultdecimal;
colors-namedA array with color names..colors-named-hexA array with color name -> Hex rgb.
As always, thanks to our amazing contributors!
Made withaction-contributors.
Licensed under the MIT License.
About
A array with color name -> decimal rgbs.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.