color-name-list 10.28.0 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ npm test && npm run build
package/README.md CHANGED
@@ -6,10 +6,10 @@
6
6
  [![GitHub release](https://img.shields.io/github/release/meodai/color-names.svg)](https://github.com/meodai/color-names/)
7
7
  [![npm version](https://img.shields.io/npm/v/color-name-list.svg)](https://www.npmjs.com/package/color-name-list)
8
8
  [![npm](https://img.shields.io/npm/dt/color-name-list.svg)](https://www.npmjs.com/package/color-name-list)
9
- [![name count](https://img.shields.io/badge/__30241__-names-orange.svg)](https://github.com/meodai/color-names/blob/master/src/colornames.csv)
9
+ [![name count](https://img.shields.io/badge/__30242__-names-orange.svg)](https://github.com/meodai/color-names/blob/master/src/colornames.csv)
10
10
  [![github sponsor count](https://img.shields.io/github/sponsors/meodai)](https://github.com/sponsors/meodai)
11
11
 
12
- A handpicked list of __30241__ unique color names from
12
+ A handpicked list of __30242__ unique color names from
13
13
  [various sources](#sources-) and thousands of curated user submissions.
14
14
 
15
15
  > The names of color function like a thread attached to a frightfully slender
@@ -23,7 +23,7 @@ A handpicked list of __30241__ unique color names from
23
23
  | <a href="#usage-">Usage</a>
24
24
  | <a href="#cdn-">CDN</a>
25
25
  | <a href="#api-">Public Rest API</a>
26
- | <a href="#usage-js-">Usage JS</a>
26
+ | <a href="#usage-js-">Usage JS/Java/Kotlin</a>
27
27
  | <a href="#sources-">Name Sources</a>
28
28
  | <a href="#latest-color-names-">Latest Color Names</a>
29
29
  | <a href="#costs--sponsors">Sponsors</a>
@@ -54,7 +54,7 @@ __[via form 🌈](https://docs.google.com/forms/d/e/1FAIpQLSfbS5D6owA4dQupJJ-6qh
54
54
 
55
55
  Make sure to read the [naming rules](CONTRIBUTING.md) before you contribute!
56
56
 
57
- ## Color Count: __30241__ 🎉
57
+ ## Color Count: __30242__ 🎉
58
58
 
59
59
  ~__0.18%__ of the RGB color space
60
60
 
@@ -135,12 +135,12 @@ consider using the [public rest API](#api-)
135
135
  #### Exact Color
136
136
 
137
137
  ```javascript
138
- import { colorNameList } from 'color-name-list';
138
+ import { colornames } from 'color-name-list';
139
139
 
140
- let someColor = colorNameList.find(color => color.hex === '#ffffff');
140
+ let someColor = colornames.find(color => color.hex === '#ffffff');
141
141
  console.log(someColor.name); // => white
142
142
 
143
- let someNamedColor = colorNameList.find(color => color.name === 'Eigengrau')
143
+ let someNamedColor = colornames.find(color => color.name === 'Eigengrau')
144
144
  console.log(someColor.hex); // => #16161d
145
145
  ```
146
146
 
@@ -151,10 +151,10 @@ Since there are 16777216 possible RGB colors, you might use a library such as
151
151
 
152
152
  ```js
153
153
  import nearestColor from 'nearest-color';
154
- import { colorNameList } from 'color-name-list';
154
+ import { colornames } from 'color-name-list';
155
155
 
156
156
  // nearestColor need objects {name => hex} as input
157
- const colors = colorNameList.reduce((o, { name, hex }) => Object.assign(o, { [name]: hex }), {});
157
+ const colors = colornames.reduce((o, { name, hex }) => Object.assign(o, { [name]: hex }), {});
158
158
 
159
159
  const nearest = nearestColor.from(colors);
160
160
 
@@ -176,6 +176,63 @@ npm install && npm run build
176
176
 
177
177
  See [package.json](package.json#L6) for more.
178
178
 
179
+ ### Usage Java/Kotlin ⌨
180
+
181
+ Java/Kotlin usage is maintained through this library:
182
+ [UwUAroze/Color-Names](https://github.com/UwUAroze/Color-Names).
183
+ Additional info can be found there, but basic usage is outlined below:
184
+
185
+ #### Importing - Gradle.kts
186
+
187
+ ```kts
188
+ repositories {
189
+ maven("https://jitpack.io")
190
+ }
191
+
192
+ dependencies {
193
+ implementation("me.aroze:color-names:1.0.2")
194
+ }
195
+ ```
196
+
197
+ #### Importing - Maven
198
+
199
+ ```xml
200
+ <repository>
201
+ <id>jitpack.io</id>
202
+ <url>https://jitpack.io</url>
203
+ </repository>
204
+
205
+ <dependency>
206
+ <groupId>me.aroze</groupId>
207
+ <artifactId>color-names</artifactId>
208
+ <version>1.0.2</version>
209
+ </dependency>
210
+ ```
211
+
212
+ #### Closest named color - Java
213
+
214
+ ```java
215
+ public ColorNames colorNames = new ColorNameBuilder()
216
+ .loadDefaults()
217
+ .build();
218
+
219
+ String fromHex = colorNames.getName("#facfea"); // "Classic Rose"
220
+ String fromRGB = colorNames.getName(224, 224, 255); // "Stoic White"
221
+ String fromColor = colorNames.getName(new Color(255, 219, 240)); // "Silky Pink"
222
+ ```
223
+
224
+ #### Closest named color - Kotlin
225
+
226
+ ```kt
227
+ val colorNames = ColorNameBuilder()
228
+ .loadDefaults()
229
+ .build()
230
+
231
+ val fromHex = colorNames.getName("#facfea") // "Classic Rose"
232
+ val fromRGB = colorNames.getName(224, 224, 255) // "Stoic White"
233
+ val fromColor = colorNames.getName(Color(255, 219, 240)) // "Silky Pink"
234
+ ```
235
+
179
236
  ## Sources 🗒
180
237
 
181
238
  ### Sources: Names 📇
@@ -223,7 +280,7 @@ See [package.json](package.json#L6) for more.
223
280
  ### Sponsors
224
281
 
225
282
  <!-- markdownlint-disable -->
226
- <!-- sponsors --><a href="https://github.com/dy"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;300067?u&#x3D;efb99487680bfaec22ca6433211108df3adeb52e&amp;v&#x3D;4" width="60px" alt="Dmitry Iv." /></a><a href="https://github.com/someguy9"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;62267?u&#x3D;aa297269cca2e6466b937abaeca5d6a8914922f2&amp;v&#x3D;4" width="60px" alt="Andy Feliciotti" /></a><a href="https://github.com/CanadaHonk"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;19228318?u&#x3D;eea29901f58d6357f0fc2992747d0b4b80d23c8e&amp;v&#x3D;4" width="60px" alt="Oliver Medhurst" /></a><!-- sponsors -->
283
+ <!-- sponsors --><!-- sponsors -->
227
284
  <!-- markdownlint-enable -->
228
285
 
229
286
  ### Past Sponsors
@@ -277,6 +334,7 @@ See [package.json](package.json#L6) for more.
277
334
  , [BlueChaos]
278
335
  , [nachtfunke]
279
336
  , Sean Gibbons
337
+ , Brantley Sibo
280
338
 
281
339
  ## Disclaimer 👮🏾‍
282
340
 
@@ -3516,6 +3516,7 @@ Royal Purpleness,#881177
3516
3516
  Royal Robe,#614a7b
3517
3517
  Royal Star,#fede4f
3518
3518
  Royalty,#5930a9
3519
+ Rrosy-Fingered Dawn,#c11c84
3519
3520
  Rubber Ducky,#facf58
3520
3521
  Ruby,#ca0147
3521
3522
  Ruby Fire,#f20769