ColorParser

Object in charge of parsing strings into Colors using terms defined in the given locale's translations, falling back to the bot's default locale if the input doesn't match.

The relevant translations keys are:

  • utils.colors.black

  • utils.colors.blurple (which should include purple)

  • utils.colors.fuchsia (which should include pink)

  • utils.colors.green

  • utils.colors.red

  • utils.colors.white

  • utils.colors.yellow

Translations may be split using commas, in which case any of the given values will be suitable.

Functions

Link copied to clipboard
open override fun getKoin(): Koin

Get the associated Koin instance.

Link copied to clipboard
fun parse(input: String, locale: Locale): Color?

Parse the given string into a Color based on the translations for the given locale. Falls back to the bot's default locale as required.