Skip to content

Commit e2fb506

Browse files
committed
doc: Update README.md
1 parent 254d895 commit e2fb506

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

README.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,37 @@ console.log(names.indexOf('#9ACD32')) // => 147
3838
```
3939

4040
```js
41-
import hexData from "colors-named-hex";
42-
import colors from "colors-named";
41+
'colors-named' 'colors-named-hex' 'colors-named-decimal'
42+
=============== =================== =====================
43+
const named = [ const hexs = [ const hexs = [
44+
'aliceblue', -> '#F0F8FF', -> [240, 248, 255],
45+
'antiquewhite', -> '#FAEBD7', -> [250, 235, 215],
46+
'aqua', -> '#00FFFF', -> [0, 255, 255],
47+
'aquamarine', -> '#7FFFD4', -> [127, 255, 212],
48+
'azure', -> '#F0FFFF', -> [240, 255, 255],
49+
'beige', -> '#F5F5DC', -> [245, 245, 220],
50+
'bisque', -> '#FFE4C4', -> [255, 228, 196],
51+
'black', -> '#000000', -> [0, 0, 0],
52+
'blanchedalmond', -> '#FFEBCD', -> [255, 235, 205],
53+
'blue', -> '#0000FF', -> [0, 0, 255],
54+
'blueviolet', -> '#8A2BE2', -> [138, 43, 226],
55+
'brown', -> '#A52A2A', -> [165, 42, 42],
56+
... -> ... -> ...
57+
]; ]; ];
58+
```
59+
60+
```js
61+
import hexs from "colors-named-hex";
62+
import named from "colors-named";
63+
import decimal from "colors-named-decimal";
64+
65+
decimal[named.indexOf('aliceblue')] // => [240, 248, 255]
66+
decimal[named.indexOf('red')] // => [255, 0, 0]
67+
decimal[named.indexOf('black')] // => [0, 0, 0]
4368

44-
hexData[colors.indexOf('aliceblue')] // => #F0F8FF
45-
hexData[colors.indexOf('red')] // => #FF0000
46-
hexData[colors.indexOf('black')] // => #000000
69+
hexs[named.indexOf('aliceblue')] // => #F0F8FF
70+
hexs[named.indexOf('red')] // => #FF0000
71+
hexs[named.indexOf('black')] // => #000000
4772
```
4873

4974
## API
@@ -72,7 +97,8 @@ export default hexs;
7297

7398
## Related
7499

75-
- [`colors-named`](https://github.com/jaywcjlove/colors-named) A array with color name -> Hex rgb.
100+
- [`colors-named`](https://github.com/jaywcjlove/colors-named) A array with color names.
101+
- [`colors-named-decimal`](https://github.com/jaywcjlove/colors-named-decimal) A array with color name -> decimal rgb.
76102

77103
## Contributors
78104

0 commit comments

Comments
 (0)