# getTextWithColors | pokemon-rogue-battle
Documentation for pokemon-rogue-battle

# Function getTextWithColors

- getTextWithColors(
  content: string,
  primaryStyle: TextStyle ,
  uiTheme: UiTheme ,
  forWindow?: boolean,
  ): string

  Should only be used with BBCodeText (see `()`) This does NOT work with UI showText() or showDialogue() methods. Method will do pattern match/replace and apply BBCode color/shadow styling to substrings within the content: @[<TextStyle>]{<text to color>}

  Example: passing a content string of "@[SUMMARY_BLUE]{blue text} primaryStyle text @[SUMMARY_RED]{red text}" will result in:

  - "blue text" with TextStyle.SUMMARY_BLUE applied
  - " primaryStyle text " with primaryStyle TextStyle applied
  - "red text" with TextStyle.SUMMARY_RED applied

  #### Parameters

  - content: string

    string with styling that need to be applied for BBCodeTextObject

  - primaryStyle: TextStyle

    Primary style is required in order to escape BBCode styling properly.

  - uiTheme: UiTheme

    the `UiTheme` to get TextStyle for

  - `Optional` forWindow: boolean

    set to `true` if the text is to be displayed in a window (BattleScene.addWindow) it will replace all instances of the default MONEY TextStyle by `TextStyle.MONEY_WINDOW`

  #### Returns string

  - Defined in src/ui/text.ts:295