Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmackintosh committed Mar 23, 2021
1 parent aaa8722 commit ad4ab21
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 87 deletions.
13 changes: 1 addition & 12 deletions R/pop_palettes.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ pop_palettes <- list(
#'
#' @param n Number of colors desired.
#'
#' Some palettes contain 5 colors. Those beginning with 'rock' have 4
#'
#' @param type Either continuous or discrete.
#'
#' @return A vector of colors.
Expand Down Expand Up @@ -77,14 +75,5 @@ pop_palette <- function(name, n, type = c("discrete", "continuous")) {
structure(out, class = "palette", name = name)
}

#' @export
#' @importFrom graphics rect par image text
#' @importFrom grDevices rgb
print_pal <- function(x, ...) {
n <- length(x)
old <- par(mar = c(0.5, 0.5, 0.5, 0.5))
on.exit(par(old))

image(1:n, 1, as.matrix(1:n), col = x,
ylab = "", xaxt = "n", yaxt = "n", bty = "n")
}

4 changes: 1 addition & 3 deletions man/pop_palette.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 8 additions & 72 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,100 +49,36 @@ library(popthemes)

``` r
pop_palette("aqua")
#> [1] "#B46843" "#C0AB45" "#5F8841" "#32956F" "#31A6B3" "#1EA8CF" "#2A638E"
#> [8] "#834583" "#BB3855"
#> attr(,"class")
#> [1] "palette"
#> attr(,"name")
#> [1] "aqua"
pop_palette("bangles")
#> [1] "#6D3A34" "#825137" "#A47850" "#AD9E70" "#9DA49D" "#7C708E" "#7E5876"
#> [8] "#7C5366" "#5F383F"
#> attr(,"class")
#> [1] "palette"
#> attr(,"name")
#> [1] "bangles"
pop_palette("beck")
#> [1] "#8A4736" "#C1CE7D" "#87E04D" "#92DD8E" "#9BC3D7" "#A67FC3" "#B03387"
#> [8] "#BA2874" "#A53252"
#> attr(,"class")
#> [1] "palette"
#> attr(,"name")
#> [1] "beck"
```

<img src="man/figures/README-aqua-1.png" width="33%" /><img src="man/figures/README-aqua-2.png" width="33%" /><img src="man/figures/README-aqua-3.png" width="33%" />

``` r
pop_palette("boo")
#> [1] "#B04D49" "#C06A51" "#C89B68" "#A79F62" "#4D6D7B" "#42496C" "#633D5A"
#> [8] "#934B63" "#A34351"
#> attr(,"class")
#> [1] "palette"
#> attr(,"name")
#> [1] "boo"
pop_palette("breeders")
#> [1] "#792F28" "#763F25" "#856426" "#818425" "#799821" "#3C7135" "#5F253B"
#> [8] "#89172A" "#93242A"
#> attr(,"class")
#> [1] "palette"
#> attr(,"name")
#> [1] "breeders"
pop_palette("bwitched")
#> [1] "#B1473C" "#BB553E" "#C65B3F" "#C86141" "#D26D48" "#CB7749" "#9C8F49"
#> [8] "#374E5D" "#5F2A60"
#> attr(,"class")
#> [1] "palette"
#> attr(,"name")
#> [1] "bwitched"
```

<img src="man/figures/README-boo-1.png" width="33%" /><img src="man/figures/README-boo-2.png" width="33%" /><img src="man/figures/README-boo-3.png" width="33%" />

``` r
pop_palette("deeelite")
#> [1] "#BB923A" "#8DB23C" "#83C044" "#518755" "#324976" "#3F3788" "#4B3181"
#> [8] "#8C3684" "#E1577D"
#> attr(,"class")
#> [1] "palette"
#> attr(,"name")
#> [1] "deeelite"
pop_palette("hole")
#> [1] "#67332C" "#904B32" "#A3663E" "#B98855" "#C9A466" "#D4BB6F" "#738664"
#> [8] "#5C4966" "#6D4254"
#> attr(,"class")
#> [1] "palette"
#> attr(,"name")
#> [1] "hole"
pop_palette("nodoubt")
#> [1] "#B27058" "#BB915D" "#BAAD73" "#A4B988" "#73AFA0" "#65ADBC" "#446F96"
#> [8] "#344681" "#874F8B"
#> attr(,"class")
#> [1] "palette"
#> attr(,"name")
#> [1] "nodoubt"
```

<img src="man/figures/README-deeelite-1.png" width="33%" /><img src="man/figures/README-deeelite-2.png" width="33%" /><img src="man/figures/README-deeelite-3.png" width="33%" />

``` r
pop_palette("sclub7")
#> [1] "#945644" "#C59F6F" "#9E8F64" "#5D6B58" "#496569" "#50768C" "#6288A6"
#> [8] "#7589A4" "#834370"
#> attr(,"class")
#> [1] "palette"
#> attr(,"name")
#> [1] "sclub7"
pop_palette("spice")
#> [1] "#C39384" "#DAC191" "#E8DE97" "#DDE4A2" "#B5D8C6" "#ABCEDF" "#BBC2E1"
#> [8] "#E0BFDF" "#CC798C"
#> attr(,"class")
#> [1] "palette"
#> attr(,"name")
#> [1] "spice"
pop_palette("steps")
#> [1] "#A65A57" "#D18C7E" "#F2BEA3" "#E5DFBD" "#85BACB" "#8895C4" "#BB6CA6"
#> [8] "#BA638C" "#9B535A"
#> attr(,"class")
#> [1] "palette"
#> attr(,"name")
#> [1] "steps"
```

<img src="man/figures/README-sclub-1.png" width="33%" /><img src="man/figures/README-sclub-2.png" width="33%" /><img src="man/figures/README-sclub-3.png" width="33%" />

## Credit

[Thanks to Ryo for the tvthemes
Expand Down

0 comments on commit ad4ab21

Please sign in to comment.