diff options
Diffstat (limited to 'src/util.ts')
-rw-r--r-- | src/util.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util.ts b/src/util.ts index 5490049..0d91aba 100644 --- a/src/util.ts +++ b/src/util.ts @@ -70,6 +70,13 @@ export function colorCodeFromName(colorName: string): string | undefined { } } +export function letterFromColorCode(colorCode: string): string | undefined { + for (const [key, value] of Object.entries(minecraftColorCodes)) { + if (value === colorCode) + return key + } +} + export async function sleep(ms: number): Promise<void> { await new Promise(resolve => setTimeout(resolve, ms)) } |