Skip to contents

Get named colours vector

Usage

get_colour(
  pattern = NULL,
  model = c("hex", "rgb", "cmyk", "pantone"),
  named = FALSE
)

get_colours(
  pattern = NULL,
  model = c("hex", "rgb", "cmyk", "pantone"),
  named = FALSE
)

Arguments

pattern

Optional. A character value or vector to use as a search term. Default is NULL in which case all the Oxford colours are returned.

model

A character vector of colour model. Can be "rgb", "cmyk", "hex", or "pantone". Default is "hex".

named

Logical. Should the output be a named character value or vector? Default is FALSE.

Value

A character value or vector of colour/s as per model specification. If named is TRUE, returns a named character value or vector.

Examples

get_colours()
#>  [1] "#348F41" "#B4A269" "#000000" "#6B4C24" "#E08F2A" "#C45B39" "#782C2D"
#>  [8] "#4B5430" "#002244" "#009FDA" "#000000" "#FFFFFF" "#F05023" "#FDB714"
#> [15] "#EB1C2D" "#F78D28" "#009CA7" "#00AB51" "#872B90" "#00A996" "#98252B"
#> [22] "#E16A2D" "#B88C1D" "#614776" "#006068" "#006450" "#1CABE2" "#00833D"
#> [29] "#80BD41" "#FFC20E" "#F26A21" "#E2231A" "#961A49" "#6A1E74" "#D8D1C9"
#> [36] "#777779" "#2D2926" "#374EA2" "#005EB8" "#FFFFFF" "#003087" "#005EB8"
#> [43] "#0072CE" "#41B6E6" "#00A9CE" "#231f20" "#425563" "#768692" "#E8EDEE"
#> [50] "#006747" "#009639" "#78BE20" "#00A499" "#330072" "#7C2855" "#AE2573"
#> [57] "#8A1538" "#ED8B00" "#FFB81C" "#FAE100"
get_colours(model = "rgb")
#>  [1] "52, 143, 65"   "180, 162, 105" "0, 0, 0"       "107, 76, 36"  
#>  [5] "224, 143, 42"  "196, 91, 57"   "120, 44, 45"   "75, 84, 48"   
#>  [9] "0 35 69"       "0 173 228"     "0, 0, 0"       "225, 225, 225"
#> [13] "240, 80, 35"   "253, 183, 20"  "235, 28, 45"   "247, 141, 40" 
#> [17] "0, 156, 167"   "0, 171, 81"    "135, 43, 144"  "0, 169, 150"  
#> [21] "152, 37, 43"   "225, 106, 45"  "184, 140, 29"  "97, 71, 118"  
#> [25] "0, 96, 104"    "0, 100, 80"    "0, 174, 239"   "0, 131, 62"   
#> [29] "128, 189, 65"  "255, 194, 14"  "242, 106, 33"  "226, 35, 26"  
#> [33] "150, 26, 73"   "107, 30, 116"  "216, 209, 202" "119, 119, 122"
#> [37] "45, 41, 38"    "55, 78, 162"   "0, 94, 184"    "255, 255, 255"
#> [41] "0, 48, 135"    "0, 94, 184"    "0, 114, 206"   "65, 182, 230" 
#> [45] "0, 169, 206"   "35, 31, 32"    "66, 85, 99"    "118, 134, 146"
#> [49] "232, 237, 238" "0, 103, 71"    "0, 150, 57"    "120, 190, 32" 
#> [53] "0, 164, 153"   "51, 0, 114"    "124, 40, 85"   "174, 37, 115" 
#> [57] "138, 21, 56"   "237, 139, 0"   "255, 184, 28"  "250, 225, 0"  
get_colours(pattern = "orange")
#>  [1] "#C45B39" "#F05023" "#F78D28" "#E16A2D" "#F26A21" "#ED8B00" "#C45B39"
#>  [8] "#F05023" "#F78D28" "#E16A2D" "#F26A21" "#ED8B00"
get_colours(pattern = c("orange", "brown"), named = TRUE)
#>      ACDC Orange WB Bright Orange  WB Light Orange   WB Dark Orange 
#>        "#C45B39"        "#F05023"        "#F78D28"        "#E16A2D" 
#>    UNICEF Orange       NHS Orange       ACDC Brown         WB Brown 
#>        "#F26A21"        "#ED8B00"        "#6B4C24"        "#B88C1D" 
#>      ACDC Orange WB Bright Orange  WB Light Orange   WB Dark Orange 
#>        "#C45B39"        "#F05023"        "#F78D28"        "#E16A2D" 
#>    UNICEF Orange       NHS Orange       ACDC Brown         WB Brown 
#>        "#F26A21"        "#ED8B00"        "#6B4C24"        "#B88C1D" 
get_colours(pattern = c("orange", "GREEN", "Blue"))
#>  [1] "#C45B39" "#F05023" "#F78D28" "#E16A2D" "#F26A21" "#ED8B00" "#002244"
#>  [8] "#1CABE2" "#374EA2" "#005EB8" "#003087" "#005EB8" "#0072CE" "#41B6E6"
#> [15] "#00A9CE" "#348F41" "#4B5430" "#00AB51" "#006450" "#00833D" "#80BD41"
#> [22] "#006747" "#009639" "#78BE20" "#00A499" "#002244" "#1CABE2" "#374EA2"
#> [29] "#005EB8" "#003087" "#005EB8" "#0072CE" "#41B6E6" "#00A9CE" "#C45B39"
#> [36] "#F05023" "#F78D28" "#E16A2D" "#F26A21" "#ED8B00" "#348F41" "#4B5430"
#> [43] "#00AB51" "#006450" "#00833D" "#80BD41" "#006747" "#009639" "#78BE20"
#> [50] "#00A499"