• Stars
    star
    127
  • Rank 282,790 (Top 6 %)
  • Language
    R
  • License
    Other
  • Created about 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

color manipulation R package Simply and Tidy

prismatic

R-CMD-check Codecov test coverage CRAN status Downloads Lifecycle: stable DOI

The goal of prismatic is to provide color manipulation tools in R, in a intuitive, low-dependency and functional way.

  • intuitive All the working functions are prefixed with clr_ (color) allowing for easy autocompletion.
  • low-dependency Only depends on farver.
  • functional All functions have consistent inputs and outputs and are thus fully pipeable.

Installation

You can install the released version of prismatic from CRAN with:

install.packages("prismatic")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("EmilHvitfeldt/prismatic")

Examples

All prismatic functions returns a colors object, which includes a new printing method and plotting method for quickly visualizing the colors.

library(prismatic)
library(magrittr)

terrain10 <- terrain.colors(10)

terrain10
#>  [1] "#00A600" "#2DB600" "#63C600" "#A0D600" "#E6E600" "#E8C32E" "#EBB25E"
#>  [8] "#EDB48E" "#F0C9C0" "#F2F2F2"

terrain_color <- color(terrain10)

terrain_color
#> <colors>
#> #00A600FF #2DB600FF #63C600FF #A0D600FF #E6E600FF #E8C32EFF #EBB25EFF #EDB48EFF #F0C9C0FF #F2F2F2FF

plot(terrain_color)

If crayon is available the print method will do its best to represent the colors.

library(prismatic)
library(magrittr)
ddd <- color(terrain.colors(10))

ddd
#> <colors>
#> #00A600FF #2DB600FF #63C600FF #A0D600FF #E6E600FF #E8C32EFF #EBB25EFF #EDB48EFF #F0C9C0FF #F2F2F2FF

plot(ddd)

clr_grayscale(ddd) %>% plot()

clr_lighten(ddd, 0.7) %>% plot()

clr_darken(ddd, 0.5) %>% plot()

clr_saturate(ddd, 0.5) %>% plot()

clr_desaturate(ddd, 0.5) %>% plot()

clr_negate(ddd) %>% plot()

clr_rotate(ddd, 180) %>% plot()

clr_protan(ddd) %>% plot()

clr_tritan(ddd) %>% plot()

clr_deutan(ddd) %>% plot()

Related work

This package is hugely inspired by the JavaScript library Qix-/color.

Code of Conduct

Please note that the β€˜prismatic’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

More Repositories

1

r-color-palettes

Comprehensive list of color palettes available in R β€οΈπŸ§‘πŸ’›πŸ’šπŸ’™πŸ’œ
R
1,264
star
2

paletteer

🎨🎨🎨 Collection of most color palettes in a single R package
R
779
star
3

ggpage

Creates Page Layout Visualizations in R πŸ“„πŸ“„πŸ“„
R
326
star
4

smltar

Manuscript of the book "Supervised Machine Learning for Text Analysis in R" by Emil Hvitfeldt and Julia Silge
TeX
248
star
5

RStudioConf2020Slides

Links to slides for rstudio::conf 2020
179
star
6

ISLR-tidymodels-labs

R
149
star
7

R-text-data

List of textual data sources to be used for text mining in R
139
star
8

textdata

Download, parse, store, and load text datasets instead of storing it in packages
R
69
star
9

quarto-revealjs-codewindow

quarto Revealjs pluging for styled codechunks
JavaScript
63
star
10

quarto-roughnotation

An extension that uses the roughnotation javascript library to add animated annotations to revealjs documents.
JavaScript
59
star
11

useR2020-text-modeling-tutorial

CSS
57
star
12

feature-engineering-az

Source for book "Feature Engineering A-Z"
HTML
57
star
13

friends

The Entire Transcript from Friends in Tidy Format
R
50
star
14

quarto-nes-theme

A Quarto reveal.js theme based on NES.css
SCSS
47
star
15

gganonymize

Anonymize the labels and text in a ggplot2
R
42
star
16

quarto-iframe-examples

JavaScript
41
star
17

quarto-revealjs-letterbox

A Quarto reveal.js theme based on xaringan letterbox
HTML
36
star
18

ggshapes

Adding various geometrical shapes to ggplot2
R
25
star
19

quickpalette

πŸƒβ€β™€οΈπŸŽ¨ R package for quick extraction of color palettes from text and images
R
25
star
20

quarto-designmode

Quarto Extension to enable DesignMode
JavaScript
24
star
21

emoji

Data About Emojis
R
24
star
22

quarto-revealjs-earth

Watercolor earth Quarto reveal.js theme
SCSS
22
star
23

talk-nyr-slidecraft

HTML
21
star
24

bookdown-github-actions-netlify

Example of using Github Actions to deploy bookdown on Netlify
R
21
star
25

unitscales

Adding additional ggplot2 scales that adds units
R
20
star
26

talk-quarto-theming-positconf

JavaScript
19
star
27

xaringancolor

Uniform Colors in Xaringan Presentations
R
17
star
28

xaringan-gallery

xaringan gallery, a growing collection of examples and custom themes
HTML
17
star
29

walmartAPI

Walmart Open API Wrapper
R
17
star
30

quarto-revealjs-spotlight

Quarto revealjs spotlight
Jupyter Notebook
15
star
31

quarto-revealjs-cinco-de-mayo

Cinco de Mayo Quarto reveal.js theme
JavaScript
15
star
32

horus

Visual tools to help machine learning model selection
R
14
star
33

quarto-revealjs-highlightword

quarto Revealjs pluging for styled codechunks
JavaScript
13
star
34

quarto-revealjs-seasons

quarto revealjs seasons theme template
JavaScript
13
star
35

elevators

Data Package Containing Information About Elevators in NYC
R
13
star
36

quarto-snow

Quarto Extension to add snow
JavaScript
12
star
37

scotus

Collection of Supreme Court of the United States' Opinions.
R
12
star
38

emilhvitfeldt

10
star
39

talk-branded-quarto

JavaScript
10
star
40

hcandersenr

An R Package for H.C. Andersens fairy tales
R
9
star
41

advent-of-steps

Adventofsteps slides
HTML
8
star
42

talk-useR2022-textrecipes

HTML
8
star
43

wordsalad

Provide Tools to Extract and Analyze Word Vectors
R
8
star
44

ferriswheels

Harmless data set about ferris wheels
R
8
star
45

workshop-useR2022-tidymodels

R
8
star
46

tidygutenbergr

cleaned gutenbergr text
R
7
star
47

quarto-revealjs-inverse

quarto revealjs inverse theme template
SCSS
7
star
48

talk-slc-slidecraft

JavaScript
7
star
49

tilemapr

R functions for square and hextile maps
R
7
star
50

quarto-revealjs-template

Personal Quarto Revealjs Template
SCSS
6
star
51

palette2vec

Technique to Embed Color Palettes to Multidimensional Space
R
6
star
52

talk-positconf2023-fancy-slides

HTML
6
star
53

fontscales

Use Iconographic Fonts in 'ggplot2'
R
6
star
54

offensiveR

R package that checks for offensive words in texts and documents
R
5
star
55

talk-rstudioconf2022-tidyclust

JavaScript
5
star
56

quarto-syntax-theme-editor

Low-tech quarto syntax highlighting theme editor
R
5
star
57

genderify

HTML
5
star
58

pptxtemplates

Provide themed powerpoint presentation templates to rmarkdown
R
5
star
59

index-challenge

R
5
star
60

emiladdins

Moar Addins for RStudio
R
5
star
61

rstats-adventofcode

R
5
star
62

fastTextR

An Interface to the 'fastText' Library
C++
4
star
63

aocfuns

Advent Of Code helper functions
R
4
star
64

ggrandom

Introduce Absolute Chaos to 'ggplot2'
R
4
star
65

roundabouts

R package containing roundabouts database
R
4
star
66

tidymodels-pipelines

JavaScript
4
star
67

extrasteps

More Steps for the 'recipes' Package
R
4
star
68

dplyr-slides

JavaScript
4
star
69

working-with-docker

🐳 Worked minimal examples of workflows with Docker and R
Dockerfile
4
star
70

percentify

Splitting a dataset according to percentile ranges to be used with tidy verbs
R
4
star
71

github-issue-table

HTML
3
star
72

talk-purrr-ocrug-2023

HTML
3
star
73

tidytuesday

#TidyTuesday Gallery
3
star
74

miscpalettes

R package with miscellaneous color palettes
R
3
star
75

workshop-ocrug-hackathon-nlp

HTML
3
star
76

textmodels4pharma

SCSS
3
star
77

refactoring-r

Refactoring in R
R
3
star
78

AU-2021spring-627

HTML
3
star
79

AU-2021fall-627

HTML
3
star
80

talk-harvard-tidymodels

CSS
3
star
81

talk-jsm-stunning-presentations

JavaScript
3
star
82

talk-socalrug-hackathon-feature-engineering

HTML
3
star
83

talk-branded-quarto-abuja

JavaScript
2
star
84

emilverse

Easily Install and Load Select Packages
R
2
star
85

Tree-GenViz

R
2
star
86

quarto-revealjs-merry

JavaScript
2
star
87

workshops

2
star
88

talks

My collection of talks
HTML
2
star
89

rstudioconf-agenda

HTML
2
star
90

emilfun

Personal R Package
R
2
star
91

recap

R
2
star
92

ggshuffle

Tool to determine if the plotting order impacts the resulting ggplot2
R
2
star
93

talk-positconf2023-101-slides

HTML
2
star
94

quarto-revealjs-loud

Automatic big text in quarto revealjs slides
JavaScript
2
star
95

courses

2
star
96

talk-AstraZeneca-recipes

HTML
2
star
97

talk-socal-positron

JavaScript
2
star
98

color-resources

A curated list of resources related to the use of colors
2
star
99

quarto-revealjs-yule

JavaScript
2
star
100

website-template

Jupyter Notebook
2
star