Skip to content

Commit

Permalink
fix: emoji 的分割
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Jan 30, 2024
1 parent f3a0a58 commit 17669d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/constants/emoji.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import random from '../utils/random';
export default {
picture: () => random.pick('🎆', '🌃', '🌇', '🎇', '🌌', '🌠', '🌅', '🌉', '🏞', '🌆', '🌄', '🖼', '🗾', '🎑', '🏙', '🌁'),
color(index: number) {
const arr = [...'🔴🟠🟡🟢🔵🟣⚫️⚪️🟤'];
const arr = [...new Intl.Segmenter().segment('🔴🟠🟡🟢🔵🟣⚫️⚪️🟤')].map(x => x.segment);
index = index % arr.length;
return arr[index];
},
Expand Down

0 comments on commit 17669d5

Please sign in to comment.