# Text With Color

Grammar — Text text with color color
FlagsNative | Function

Encloses the text with a color formatting tag so it will use the given color.

# Arguments

  • text — Text
  • color — Color

Returns — text

native text TextWithColor(text t, color c);

Category: String / Formatting

# Examples

mods/liberty.sc2modbase.sc2data/TriggerLibs/LibertyLib.galaxy:335

    DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
    libLbty_gv_meleeSurrender_Title[lp_player] = DialogControlLastCreated();
    libNtve_gf_SetDialogItemText(DialogControlLastCreated(), (TextWithColor(PlayerName(lp_player), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lp_player, false))) + StringExternal("Param/Value/lib_Lbty_1D191C56")), PlayerGroupAll());
    DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 360, 50);
    libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "AISurrenderTitle", PlayerGroupAll());

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:9418

            if ((TimerGetRemaining(DataTableGetTimer(true, libCOMI_gf_CM_ObjectiveTimer(lp_objective))) > 0.0)) {
                if ((TimerGetRemaining(DataTableGetTimer(true, libCOMI_gf_CM_ObjectiveTimer(lp_objective))) <= DataTableGetInt(true, (libCOMI_gf_CM_ObjectiveTimer(lp_objective) + "_" + libCOMI_ge_ObjectiveTimerThresholds_Ident(libCOMI_ge_ObjectiveTimerThresholds_Red))))) {
                    lv_name = TextReplaceWord(lv_name, StringExternal("Param/Value/lib_COMI_251B217F"), TextWithColor(TextTimeFormat(StringToText("<mintotal/>:<sec2/>"), FixedToInt(TimerGetRemaining(DataTableGetTimer(true, libCOMI_gf_CM_ObjectiveTimer(lp_objective))))), Color(100.00, 0.00, 0.00)), c_stringReplaceAll, c_stringCase);
                }
                else {

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:9422

                else {
                    if ((TimerGetRemaining(DataTableGetTimer(true, libCOMI_gf_CM_ObjectiveTimer(lp_objective))) <= DataTableGetInt(true, (libCOMI_gf_CM_ObjectiveTimer(lp_objective) + "_" + libCOMI_ge_ObjectiveTimerThresholds_Ident(libCOMI_ge_ObjectiveTimerThresholds_Yellow))))) {
                        lv_name = TextReplaceWord(lv_name, StringExternal("Param/Value/lib_COMI_A59236C2"), TextWithColor(TextTimeFormat(StringToText("<mintotal/>:<sec2/>"), FixedToInt(TimerGetRemaining(DataTableGetTimer(true, libCOMI_gf_CM_ObjectiveTimer(lp_objective))))), Color(100.00, 100.00, 0.00)), c_stringReplaceAll, c_stringCase);
                    }
                    else {

mods/warcoop/warclassic.sc2modbase.sc2data/TriggerLibs/WarClassic.galaxy:1069

    lv_name = StringExternal(("Name/" + (lv_uT)));
    lv_level = UnitLevel(lv_u);
    TextExpressionSetToken("Param/Expression/lib_GAw3_EE11EABC", "Prop", TextWithColor(lv_prop, lv_color));
    TextExpressionSetToken("Param/Expression/lib_GAw3_EE11EABC", "Name", lv_name);
    TextExpressionSetToken("Param/Expression/lib_GAw3_EE11EABC", "Level", IntToText(lv_level));