UNPKG

scrabble-solver

Version:

Scrabble Solver 2 - Free, open-source, cross-platform, multi-language analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Letter League, Literaki, and Kelimelik. Quickly find the top-scoring words using the given board and tiles.

17 lines (12 loc) 492 B
import { BONUS_WORD } from '@scrabble-solver/constants'; import { Bonus } from '@scrabble-solver/types'; import { COLOR_BONUS_CHARACTER, COLOR_BONUS_CHARACTER_MULTIPLIER, COLOR_BONUS_WORD } from 'parameters'; export const getBonusColor = (bonus: Bonus): string => { if (bonus.type === BONUS_WORD) { return COLOR_BONUS_WORD[bonus.multiplier]; } if (bonus.score) { return COLOR_BONUS_CHARACTER[bonus.score]; } return COLOR_BONUS_CHARACTER_MULTIPLIER[bonus.multiplier]; };