Colour palette

library(arphit)
png(height = 6, width = 5, filename = "colour_palette.png", units = "in", res = 300)
graphics::par(mar = c(0, 0, 0, 0))
graphics::plot(0, lwd = 0, pch = NA, axes = FALSE, xlab = "", ylab = "", xlim = c(0,1), ylim = c(0,6/5))

colours <- c("Red", "Orange", "Brown", "Olive", "Green", "DarkGreen", "Aqua", "Blue", "Violet", "Purple", "Maroon", "Pink", "Grey", "Default")


# Draw the Numbers at the top
xoff <- 0.11
for (i in 1:10) {
  xoff <- xoff + 0.08
  text(i, x = xoff, y = 6/5 - 0.025)
}

# Draw each of the colourss and boxes
yoff <- 6/5 - 0.02
for (col in colours) {
  yoff <- yoff - 0.08
  xoff <- 0.15
  text(col, x = 0.05, y = yoff)
  for (i in 1:10) {
    xoff <- xoff + 0.08
    if(!is.na(RBA[paste(col, i, sep = "")])) {
      graphics::rect(xoff, yoff - 0.03, xoff - 0.06, yoff + 0.03, col = RBA[paste(col, i, sep = "")], lty = 1)
    }
  }
}
dev.off()
knitr::include_graphics("colour_palette.png")


angusmoore/arphit documentation built on Feb. 15, 2021, 9:40 a.m.