Skip to content

Commit 5538445

Browse files
committed
better color name for balloon
1 parent ee76b31 commit 5538445

File tree

2 files changed

+106
-111
lines changed

2 files changed

+106
-111
lines changed

packages/server/client/balloon.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ let timer = null;
7272
let printer = null;
7373

7474
async function printBalloon(doc, lang) {
75-
const status = (doc.total ? Object.keys(doc.total).map(async (k) =>
76-
`- ${k}: ${lang === 'zh' ? await convertToChinese(doc.total[k].color) : doc.total[k].color}`).join('\n') : 'N/A');
75+
let status = '';
76+
for (const i in doc.total) {
77+
status += `- ${i}: ${lang === 'zh' ? await convertToChinese(doc.total[i].color) : doc.total[i].color}\n`;
78+
}
7779
const bReceipt = receiptText(
7880
doc.balloonid,
7981
doc.location ? doc.location : 'N/A',

packages/server/utils/color.ts

Lines changed: 102 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -151,151 +151,144 @@ export const HTML_COLORS = {
151151
export const CHINESE_NAME = {
152152
aliceblue: '艾利斯兰',
153153
antiquewhite: '古董白',
154-
aqua: '浅绿色',
155-
aquamarine: '碧绿色',
156-
azure: '天蓝色',
154+
aqua: '水绿色',
155+
aquamarine: '碧绿',
156+
azure: '天蓝',
157157
beige: '米色',
158-
bisque: '桔黄色',
158+
bisque: '桔黄',
159159
black: '黑色',
160-
blanchedalmond: '白杏色',
160+
blanchedalmond: '白杏',
161161
blue: '蓝色',
162-
blueviolet: '紫罗兰色',
163-
brown: '褐色',
162+
blueviolet: '蓝紫色',
163+
brown: '棕色',
164164
burlywood: '实木色',
165-
cadetblue: '军兰色',
166-
chartreuse: '黄绿色',
167-
chocolate: '巧可力色',
165+
cadetblue: '军蓝',
166+
chartreuse: '浅黄绿色',
167+
chocolate: '巧克力色',
168168
coral: '珊瑚色',
169-
cornflowerblue: '菊兰色',
170-
cornsilk: '米绸色',
171-
crimson: '暗深红色',
169+
cornflowerblue: '矢车菊蓝',
170+
cornsilk: '玉米丝色',
171+
crimson: '绯红',
172172
cyan: '青色',
173-
darkblue: '暗蓝色',
174-
darkcyan: '暗青色',
175-
darkgoldenrod: '暗金黄色',
176-
darkgray: '暗灰色',
177-
darkgreen: '暗绿色',
178-
darkgrey: '暗灰色',
179-
darkkhaki: '暗黄褐色',
180-
darkmagenta: '暗洋红',
181-
darkolivegreen: '暗橄榄绿',
182-
darkorange: '暗桔黄色',
183-
darkorchid: '暗紫色',
184-
darkred: '暗红色',
185-
darksalmon: '暗肉色',
186-
darkseagreen: '暗海兰色',
187-
darkslateblue: '暗灰蓝色',
188-
darkslategray: '暗瓦灰色',
189-
darkslategrey: '暗瓦灰色',
190-
darkturquoise: '暗宝石绿',
191-
darkviolet: '暗紫罗兰色',
192-
deeppink: '深粉红色',
193-
deepskyblue: '深天蓝色',
194-
dimgray: '暗灰色',
195-
dimgrey: '暗灰色',
196-
dodgerblue: '闪兰色',
173+
darkblue: '深蓝',
174+
darkcyan: '深青',
175+
darkgoldenrod: '深金黄色',
176+
darkgray: '深灰',
177+
darkgreen: '深绿',
178+
darkkhaki: '深卡其色',
179+
darkmagenta: '深紫红色',
180+
darkolivegreen: '深橄榄绿',
181+
darkorange: '深橙色',
182+
darkorchid: '深兰花紫',
183+
darkred: '深红',
184+
darksalmon: '深橙红',
185+
darkseagreen: '深海绿',
186+
darkslateblue: '深板岩蓝',
187+
darkslategray: '深板岩灰',
188+
darkturquoise: '深宝石绿',
189+
darkviolet: '深紫罗兰',
190+
deeppink: '深粉红',
191+
deepskyblue: '深天蓝',
192+
dimgray: '暗灰',
193+
dodgerblue: '道奇蓝',
197194
firebrick: '火砖色',
198-
floralwhite: '花白色',
195+
floralwhite: '花白',
199196
forestgreen: '森林绿',
200-
fuchsia: '紫红色',
201-
gainsboro: '淡灰色',
197+
fuchsia: '紫红',
198+
gainsboro: '亮灰',
202199
ghostwhite: '幽灵白',
203200
gold: '金色',
204-
goldenrod: '金麒麟色',
201+
goldenrod: '金菊黄',
205202
gray: '灰色',
206203
green: '绿色',
207-
greenyellow: '黄绿色',
208-
grey: '灰色',
209-
honeydew: '蜜色',
210-
hotpink: '热粉红色',
211-
indianred: '印第安红',
212-
indigo: '靛青色',
204+
greenyellow: '绿黄色',
205+
honeydew: '蜜瓜色',
206+
hotpink: '亮粉红',
207+
indianred: '印度红',
208+
indigo: '靛青',
213209
ivory: '象牙色',
214-
khaki: '黄褐色',
215-
lavender: '淡紫色',
210+
khaki: '卡其色',
211+
lavender: '薰衣草色',
216212
lavenderblush: '淡紫红',
217-
lawngreen: '草绿色',
213+
lawngreen: '草绿',
218214
lemonchiffon: '柠檬绸色',
219-
lightblue: '亮蓝色',
220-
lightcoral: '亮珊瑚色',
221-
lightcyan: '亮青色',
222-
lightgoldenrodyellow: '亮金黄色',
223-
lightgray: '亮灰色',
224-
lightgreen: '亮绿色',
225-
lightgrey: '亮灰色',
226-
lightpink: '亮粉红色',
227-
lightsalmon: '亮肉色',
228-
lightseagreen: '亮海蓝色',
229-
lightskyblue: '亮天蓝色',
230-
lightslategray: '亮蓝灰',
231-
lightslategrey: '亮蓝灰',
232-
lightsteelblue: '亮钢兰色',
233-
lightyellow: '亮黄色',
215+
lightblue: '淡蓝',
216+
lightcoral: '浅珊瑚色',
217+
lightcyan: '浅青',
218+
lightgoldenrodyellow: '浅金黄色',
219+
lightgray: '浅灰',
220+
lightgreen: '浅绿',
221+
lightpink: '浅粉',
222+
lightsalmon: '浅橙红',
223+
lightseagreen: '浅海绿',
224+
lightskyblue: '浅天蓝',
225+
lightslategray: '浅板岩灰',
226+
lightsteelblue: '浅钢蓝',
227+
lightyellow: '浅黄',
234228
lime: '酸橙色',
235-
limegreen: '橙绿色',
229+
limegreen: '酸橙绿',
236230
linen: '亚麻色',
237-
magenta: '红紫色',
238-
maroon: '粟色',
239-
mediumaquamarine: '中绿色',
240-
mediumblue: '中兰色',
241-
mediumorchid: '中粉紫色',
242-
mediumpurple: '中紫色',
243-
mediumseagreen: '中海蓝',
244-
mediumslateblue: '中暗蓝色',
245-
mediumspringgreen: '中春绿色',
246-
mediumturquoise: '中绿宝石',
247-
mediumvioletred: '中紫罗兰色',
248-
midnightblue: '中灰兰色',
249-
mintcream: '薄荷色',
250-
mistyrose: '浅玫瑰色',
231+
magenta: '洋红',
232+
maroon: '栗色',
233+
mediumaquamarine: '中碧绿',
234+
mediumblue: '中蓝',
235+
mediumorchid: '中兰花紫',
236+
mediumpurple: '中紫',
237+
mediumseagreen: '中海绿',
238+
mediumslateblue: '中板岩蓝',
239+
mediumspringgreen: '中春绿',
240+
mediumturquoise: '中宝石绿',
241+
mediumvioletred: '中紫罗兰',
242+
midnightblue: '午夜蓝',
243+
mintcream: '薄荷乳白',
244+
mistyrose: '薄雾玫瑰',
251245
moccasin: '鹿皮色',
252246
navajowhite: '纳瓦白',
253-
navy: '海军色',
247+
navy: '海军蓝',
254248
oldlace: '老花色',
255249
olive: '橄榄色',
256-
olivedrab: '深绿褐色',
250+
olivedrab: '橄榄褐',
257251
orange: '橙色',
258-
orangered: '红橙色',
259-
orchid: '淡紫色',
260-
palegoldenrod: '苍麒麟色',
261-
palegreen: '苍绿色',
262-
paleturquoise: '苍宝石绿',
263-
palevioletred: '苍紫罗兰色',
252+
orangered: '橙红色',
253+
orchid: '兰花紫',
254+
palegoldenrod: '灰菊黄',
255+
palegreen: '灰绿',
256+
paleturquoise: '灰宝石绿',
257+
palevioletred: '灰紫罗兰',
264258
papayawhip: '番木色',
265259
peachpuff: '桃色',
266260
peru: '秘鲁色',
267-
pink: '粉红色',
261+
pink: '粉红',
268262
plum: '洋李色',
269-
powderblue: '粉蓝色',
263+
powderblue: '粉蓝',
270264
purple: '紫色',
271265
red: '红色',
272-
rosybrown: '褐玫瑰红',
266+
rosybrown: '玫瑰褐',
273267
royalblue: '皇家蓝',
274-
saddlebrown: '重褐色',
275-
salmon: '鲜肉色',
276-
sandybrown: '沙褐色',
277-
seagreen: '海绿色',
278-
seashell: '海贝色',
268+
saddlebrown: '马鞍褐',
269+
salmon: '鲑色',
270+
sandybrown: '沙褐',
271+
seagreen: '海绿',
272+
seashell: '贝壳白',
279273
sienna: '赭色',
280274
silver: '银色',
281-
skyblue: '天蓝色',
282-
slateblue: '石蓝色',
283-
slategray: '灰石色',
284-
slategrey: '灰石色',
285-
snow: '雪白色',
286-
springgreen: '春绿色',
287-
steelblue: '钢兰色',
275+
skyblue: '天蓝',
276+
slateblue: '板岩蓝',
277+
slategray: '板岩灰',
278+
snow: '雪白',
279+
springgreen: '春绿',
280+
steelblue: '钢蓝',
288281
tan: '茶色',
289282
teal: '水鸭色',
290283
thistle: '蓟色',
291-
tomato: '西红柿色',
292-
turquoise: '青绿色',
293-
violet: '紫罗兰色',
294-
wheat: '浅黄色',
284+
tomato: '番茄红',
285+
turquoise: '宝石绿',
286+
violet: '紫罗兰',
287+
wheat: '小麦色',
295288
white: '白色',
296-
whitesmoke: '烟白色',
289+
whitesmoke: '烟白',
297290
yellow: '黄色',
298-
yellowgreen: '黄绿色',
291+
yellowgreen: '黄绿',
299292
};
300293

301294
export function convertToColor(hex) {

0 commit comments

Comments
 (0)