Skip to content

Commit 21f5722

Browse files
committed
add short list
1 parent dcae180 commit 21f5722

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"homepage": "https://github.com/meodai/color-name-api#readme",
3737
"dependencies": {
3838
"@supabase/supabase-js": "^2.7.1",
39-
"color-name-list": "^10.24.2",
39+
"color-name-list": "^10.25.0",
4040
"color-name-lists": "^3.27.0",
4141
"culori": "^2.0.3",
4242
"dotenv": "^16.0.3",

src/server.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import fs from 'fs';
66
import colorNameLists from 'color-name-lists';
77
import colors from 'color-name-list/dist/colornames.esm.mjs';
88
import colorsBestOf from 'color-name-list/dist/colornames.bestof.esm.mjs';
9+
import colorsShort from 'color-name-list/dist/colornames.short.esm.mjs';
910
import { Server } from 'socket.io';
1011
import requestIp from 'request-ip';
1112
import * as dotenv from 'dotenv';
@@ -72,6 +73,7 @@ const responseHandlerHTML = {
7273
const colorsLists = {
7374
default: colors,
7475
bestOf: colorsBestOf,
76+
short: colorsShort,
7577
};
7678

7779
Object.assign(colorsLists, colorNameLists.lists);
@@ -97,6 +99,14 @@ colorNameLists.meta.bestOf = {
9799
colorCount: colorsBestOf.length,
98100
};
99101

102+
colorNameLists.meta.short = {
103+
title: 'Short Color Names',
104+
source: 'https://github.com/meodai/color-names',
105+
description: 'A list of short color names. (One word less than 12 characters)',
106+
key: 'short',
107+
colorCount: colorsShort.length,
108+
};
109+
100110
// add endpoint urls to the meta data
101111
Object.keys(colorNameLists.meta).forEach(
102112
(key) => {

0 commit comments

Comments
 (0)