match_alias: Match Color or Style Aliases

View source: R/alert.R

match_aliasR Documentation

Match Color or Style Aliases

Description

Returns the Official Color or Style Designation from Any Alias

Usage

match_alias()

.match_bg(x)

.match_fg(x)

.match_st(x)

Arguments

x

A character scalar alias.

Value

A 3-letter character scalar.

Functions

  • .match_bg(): Matches any valid alias for background color.

  • .match_fg(): Matches any valid alias for foreground color.

  • .match_st(): Matches any valid alias for style.

Examples

egMatchAlias <- function() {
  base::list(
    st = base::list(bld = base::list(b = uj::.match_st("b"),
                                     bo = uj::.match_st("bo"),
                                     bld = uj::.match_st("bld"),
                                     bold = uj::.match_st("bold"),
                                     bolded = uj::.match_st("bolded"),
                                     s = uj::.match_st("s"),
                                     st = uj::.match_st("st"),
                                     str = uj::.match_st("str"),
                                     strong = uj::.match_st("strong"),
                                     strengthened = uj::.match_st("strengthened")),
                    itl = base::list(i = uj::.match_st("i"),
                                     it = uj::.match_st("it"),
                                     itl = uj::.match_st("itl"),
                                     italic = uj::.match_st("italic"),
                                     italicized = uj::.match_st("italicized"),
                                     e = uj::.match_st("e"),
                                     em = uj::.match_st("em"),
                                     emp = uj::.match_st("emp"),
                                     emph = uj::.match_st("emph"),
                                     emphasis = uj::.match_st("emphasis"),
                                     emphasized = uj::.match_st("emphasized")),
                    und = base::list(u = uj::.match_st("u"),
                                     un = uj::.match_st("un"),
                                     und = uj::.match_st("und"),
                                     under = uj::.match_st("under"),
                                     underline = uj::.match_st("underline"),
                                     underlined = uj::.match_st("underlined")),
                    pln = base::list(p = uj::.match_st("p"),
                                     pl = uj::.match_st("pl"),
                                     pln = uj::.match_st("pln"),
                                     plain = uj::.match_st("plain"),
                                     r = uj::.match_st("r"),
                                     res = uj::.match_st("res"),
                                     reset = uj::.match_st("reset"),
                                     d = uj::.match_st("d"),
                                     def = uj::.match_st("def"),
                                     default = uj::.match_st("default"))),
    fg = base::list(blk = base::list(k = uj::.match_fg("k"),
                                     blk = uj::.match_fg("blk"),
                                     black = uj::.match_fg("black")),
                    blu = base::list(b = uj::.match_fg("b"),
                                     blu = uj::.match_fg("blu"),
                                     blue = uj::.match_fg("blue")),
                    cyn = base::list(c = uj::.match_fg("c"),
                                     cyn = uj::.match_fg("cyn"),
                                     cyan = uj::.match_fg("cyan")),
                    def = base::list(d = uj::.match_fg("d"),
                                     def = uj::.match_fg("def"),
                                     default = uj::.match_fg("default")),
                    grn = base::list(g = uj::.match_fg("g"),
                                     grn = uj::.match_fg("grn"),
                                     green = uj::.match_fg("green")),
                    mag = base::list(m = uj::.match_fg("m"),
                                     mag = uj::.match_fg("mag"),
                                     magenta = uj::.match_fg("magenta")),
                    red = base::list(r = uj::.match_fg("r"),
                                     red = uj::.match_fg("red")),
                    wht = base::list(w = uj::.match_fg("w"),
                                     wht = uj::.match_fg("wht"),
                                     white = uj::.match_fg("white")),
                    yel = base::list(y = uj::.match_fg("y"),
                                     yel = uj::.match_fg("yel"),
                                     ylw = uj::.match_fg("ylw"),
                                     yellow = uj::.match_fg("yellow"))),
    bg = base::list(blk = base::list(k = uj::.match_bg("k"),
                                     blk = uj::.match_bg("blk"),
                                     black = uj::.match_bg("black")),
                    blu = base::list(b = uj::.match_bg("b"),
                                     blu = uj::.match_bg("blu"),
                                     blue = uj::.match_bg("blue")),
                    cyn = base::list(c = uj::.match_bg("c"),
                                     cyn = uj::.match_bg("cyn"),
                                     cyan = uj::.match_bg("cyan")),
                    def = base::list(d = uj::.match_bg("d"),
                                     def = uj::.match_bg("def"),
                                     default = uj::.match_bg("default")),
                    grn = base::list(g = uj::.match_bg("g"),
                                     grn = uj::.match_bg("grn"),
                                     green = uj::.match_bg("green")),
                    mag = base::list(m = uj::.match_bg("m"),
                                     mag = uj::.match_bg("mag"),
                                     magenta = uj::.match_bg("magenta")),
                    red = base::list(r = uj::.match_bg("r"),
                                     red = uj::.match_bg("red")),
                    sil = base::list(s = uj::.match_bg("s"),
                                     gry = uj::.match_bg("gry"),
                                     sil = uj::.match_bg("sil"),
                                     slv = uj::.match_bg("slv"),
                                     gray = uj::.match_bg("gray"),
                                     grey = uj::.match_bg("grey"),
                                     silver = uj::.match_bg("silver")),
                    wht = base::list(w = uj::.match_bg("w"),
                                     wht = uj::.match_bg("wht"),
                                     white = uj::.match_bg("white")),
                    yel = base::list(y = uj::.match_bg("y"),
                                     yel = uj::.match_bg("yel"),
                                     ylw = uj::.match_bg("ylw"),
                                     yellow = uj::.match_bg("yellow")))
  )
}
egMatchAlias()

j-martineau/uj documentation built on Sept. 14, 2024, 4:40 a.m.