Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

hoesler/rwantshue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rwantshue

Build Status

Generate an i want hue color palette in R.

Install

Use devtools to install:

devtools::install_github("hoesler/rwantshue")

Usage

library('rwantshue')

# create a color scheme object
scheme <- iwanthue() # get the iwanthue singleton
scheme <- iwanthue(seed = 42, force_init = TRUE) # recreate with a seed

# generate a new color palette (vector of hex values) with presets...
scheme$hex(10)
scheme$hex(10, color_space = hcl_presets$fluo)

# ... or make custom adjustments:
color_space <- list(
	c(330, 360),	# hue range [0,360]
	c(0, 100),		# chroma range [0,100]
	c(0, 100))		# lightness range [0,100]
palette <- scheme$hex(
	n = 8,
	force_mode = FALSE,
	quality = 50,
	color_space = color_space)
	
# use it in a plot
plot(1:8, col = scheme$hex(8), pch = 16, cex = 10)

# You can also fetch a rgb matrix
scheme$rgb(8)

About

An "i want hue" color palette generator for R

Resources

License

Stars

Watchers

Forks

Packages

No packages published