R/color-provider-en_US.R

# modified from the python library faker:
# https://github.com/joke2k/faker/blob/master/faker/providers/color/__init__.py

#' @title ColorProvider
#' @inherit ColorProvider description details return
#' @export
#' @family en
#' @family US
#' @examples
#' x <- ColorProvider_en_US$new()
#' x$locale
#' x$color_name()
#' x$safe_color_name()
#' x$hex_color()
#' x$safe_hex_color()
#' x$rgb_color()
#' x$rgb_css_color()
ColorProvider_en_US <- R6::R6Class(
  inherit = ColorProvider,
  "ColorProvider_en_US",
  lock_objects = FALSE,
  private = list(

    #  A vector with named list items containing the name of the color and the hex value.
    all_colors_ = c(
      list(AliceBlue = "#F0F8FF"),
      list(AntiqueWhite = "#FAEBD7"),
      list(Aqua = "#00FFFF"),
      list(Aquamarine = "#7FFFD4"),
      list(Azure = "#F0FFFF"),
      list(Beige = "#F5F5DC"),
      list(Bisque = "#FFE4C4"),
      list(Black = "#000000"),
      list(BlanchedAlmond = "#FFEBCD"),
      list(Blue = "#0000FF"),
      list(BlueViolet = "#8A2BE2"),
      list(Brown = "#A52A2A"),
      list(BurlyWood = "#DEB887"),
      list(CadetBlue = "#5F9EA0"),
      list(Chartreuse = "#7FFF00"),
      list(Chocolate = "#D2691E"),
      list(Coral = "#FF7F50"),
      list(CornflowerBlue = "#6495ED"),
      list(Cornsilk = "#FFF8DC"),
      list(Crimson = "#DC143C"),
      list(Cyan = "#00FFFF"),
      list(DarkBlue = "#00008B"),
      list(DarkCyan = "#008B8B"),
      list(DarkGoldenRod = "#B8860B"),
      list(DarkGray = "#A9A9A9"),
      list(DarkGreen = "#006400"),
      list(DarkKhaki = "#BDB76B"),
      list(DarkMagenta = "#8B008B"),
      list(DarkOliveGreen = "#556B2F"),
      list(DarkOrange = "#FF8C00"),
      list(DarkOrchid = "#9932CC"),
      list(DarkRed = "#8B0000"),
      list(DarkSalmon = "#E9967A"),
      list(DarkSeaGreen = "#8FBC8F"),
      list(DarkSlateBlue = "#483D8B"),
      list(DarkSlateGray = "#2F4F4F"),
      list(DarkTurquoise = "#00CED1"),
      list(DarkViolet = "#9400D3"),
      list(DeepPink = "#FF1493"),
      list(DeepSkyBlue = "#00BFFF"),
      list(DimGray = "#696969"),
      list(DodgerBlue = "#1E90FF"),
      list(FireBrick = "#B22222"),
      list(FloralWhite = "#FFFAF0"),
      list(ForestGreen = "#228B22"),
      list(Fuchsia = "#FF00FF"),
      list(Gainsboro = "#DCDCDC"),
      list(GhostWhite = "#F8F8FF"),
      list(Gold = "#FFD700"),
      list(GoldenRod = "#DAA520"),
      list(Gray = "#808080"),
      list(Green = "#008000"),
      list(GreenYellow = "#ADFF2F"),
      list(HoneyDew = "#F0FFF0"),
      list(HotPink = "#FF69B4"),
      list(IndianRed = "#CD5C5C"),
      list(Indigo = "#4B0082"),
      list(Ivory = "#FFFFF0"),
      list(Khaki = "#F0E68C"),
      list(Lavender = "#E6E6FA"),
      list(LavenderBlush = "#FFF0F5"),
      list(LawnGreen = "#7CFC00"),
      list(LemonChiffon = "#FFFACD"),
      list(LightBlue = "#ADD8E6"),
      list(LightCoral = "#F08080"),
      list(LightCyan = "#E0FFFF"),
      list(LightGoldenRodYellow = "#FAFAD2"),
      list(LightGray = "#D3D3D3"),
      list(LightGreen = "#90EE90"),
      list(LightPink = "#FFB6C1"),
      list(LightSalmon = "#FFA07A"),
      list(LightSeaGreen = "#20B2AA"),
      list(LightSkyBlue = "#87CEFA"),
      list(LightSlateGray = "#778899"),
      list(LightSteelBlue = "#B0C4DE"),
      list(LightYellow = "#FFFFE0"),
      list(Lime = "#00FF00"),
      list(LimeGreen = "#32CD32"),
      list(Linen = "#FAF0E6"),
      list(Magenta = "#FF00FF"),
      list(Maroon = "#800000"),
      list(MediumAquaMarine = "#66CDAA"),
      list(MediumBlue = "#0000CD"),
      list(MediumOrchid = "#BA55D3"),
      list(MediumPurple = "#9370DB"),
      list(MediumSeaGreen = "#3CB371"),
      list(MediumSlateBlue = "#7B68EE"),
      list(MediumSpringGreen = "#00FA9A"),
      list(MediumTurquoise = "#48D1CC"),
      list(MediumVioletRed = "#C71585"),
      list(MidnightBlue = "#191970"),
      list(MintCream = "#F5FFFA"),
      list(MistyRose = "#FFE4E1"),
      list(Moccasin = "#FFE4B5"),
      list(NavajoWhite = "#FFDEAD"),
      list(Navy = "#000080"),
      list(OldLace = "#FDF5E6"),
      list(Olive = "#808000"),
      list(OliveDrab = "#6B8E23"),
      list(Orange = "#FFA500"),
      list(OrangeRed = "#FF4500"),
      list(Orchid = "#DA70D6"),
      list(PaleGoldenRod = "#EEE8AA"),
      list(PaleGreen = "#98FB98"),
      list(PaleTurquoise = "#AFEEEE"),
      list(PaleVioletRed = "#DB7093"),
      list(PapayaWhip = "#FFEFD5"),
      list(PeachPuff = "#FFDAB9"),
      list(Peru = "#CD853F"),
      list(Pink = "#FFC0CB"),
      list(Plum = "#DDA0DD"),
      list(PowderBlue = "#B0E0E6"),
      list(Purple = "#800080"),
      list(Red = "#FF0000"),
      list(RosyBrown = "#BC8F8F"),
      list(RoyalBlue = "#4169E1"),
      list(SaddleBrown = "#8B4513"),
      list(Salmon = "#FA8072"),
      list(SandyBrown = "#F4A460"),
      list(SeaGreen = "#2E8B57"),
      list(SeaShell = "#FFF5EE"),
      list(Sienna = "#A0522D"),
      list(Silver = "#C0C0C0"),
      list(SkyBlue = "#87CEEB"),
      list(SlateBlue = "#6A5ACD"),
      list(SlateGray = "#708090"),
      list(Snow = "#FFFAFA"),
      list(SpringGreen = "#00FF7F"),
      list(SteelBlue = "#4682B4"),
      list(Tan = "#D2B48C"),
      list(Teal = "#008080"),
      list(Thistle = "#D8BFD8"),
      list(Tomato = "#FF6347"),
      list(Turquoise = "#40E0D0"),
      list(Violet = "#EE82EE"),
      list(Wheat = "#F5DEB3"),
      list(White = "#FFFFFF"),
      list(WhiteSmoke = "#F5F5F5"),
      list(Yellow = "#FFFF00"),
      list(YellowGreen = "#9ACD3")
    ),
    safe_colors_ = c(
      "black", "maroon", "green", "navy", "olive",
      "purple", "teal", "lime", "blue", "silver",
      "gray", "yellow", "fuchsia", "aqua", "white"
    ),
    locale_ = "en_US"
  )
)
ropensci/charlatan documentation built on Oct. 24, 2023, 9:15 a.m.