All Projects → EmilHvitfeldt → prismatic

EmilHvitfeldt / prismatic

Licence: Unknown, MIT licenses found Licenses found Unknown LICENSE MIT LICENSE.md
color manipulation R package Simply and Tidy

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to prismatic

shades
Simple colour manipulation in R
Stars: ✭ 70 (-42.15%)
Mutual labels:  color, colour, color-manipulation
stellarized
✦ paint vim with the stars ✦
Stars: ✭ 70 (-42.15%)
Mutual labels:  color, colour
icc
JavaScript module to parse International Color Consortium (ICC) profiles
Stars: ✭ 37 (-69.42%)
Mutual labels:  color, colour
tc-lib-color
PHP library to manipulate various color representations
Stars: ✭ 19 (-84.3%)
Mutual labels:  color, colour
ColorTranslator
A JavaScript library, written in TypeScript, to convert among different color models
Stars: ✭ 34 (-71.9%)
Mutual labels:  color, color-manipulation
colour
Validate colours.
Stars: ✭ 31 (-74.38%)
Mutual labels:  color, colour
Chromatism
🌈 A simple set of utility functions for colours.
Stars: ✭ 1,763 (+1357.02%)
Mutual labels:  color, colour
colour-notebooks
Colour - Jupyter Notebooks
Stars: ✭ 21 (-82.64%)
Mutual labels:  color, colour
SwiftColorWheel
Delightful color picker wheel for iOS in Swift.
Stars: ✭ 37 (-69.42%)
Mutual labels:  color, colour
leeks.js
Simple ANSI styling for your terminal
Stars: ✭ 12 (-90.08%)
Mutual labels:  color, colour
php-invert-color
Invert a given color.
Stars: ✭ 13 (-89.26%)
Mutual labels:  color, colour
colored-console
🌈 Add some color to your console >_
Stars: ✭ 74 (-38.84%)
Mutual labels:  color, colour
dehex
🎨👀 R package: learn to assess a colour hex code by eye
Stars: ✭ 29 (-76.03%)
Mutual labels:  color, colour
colr pickr
Colr Pickr, a vanilla JavaScript color picker component built with SVGs, with features like saving colors. Similar design to the chrome-dev-tools color picker.
Stars: ✭ 27 (-77.69%)
Mutual labels:  color, colour
colour-nuke
Colour - Nuke
Stars: ✭ 145 (+19.83%)
Mutual labels:  color, colour
react-material-color-picker
react-material-color-picker component for selecting colors from google material color palette 📃
Stars: ✭ 19 (-84.3%)
Mutual labels:  color
react-scrolling-color-background
background with color transitioning as you scroll, declarative and easy to setup
Stars: ✭ 53 (-56.2%)
Mutual labels:  color
noire
🎨 Light/darken, mix, (de)saturate the colors in Golang with CMYK / RGB / HSV / HSL / Hex / HTML supported.
Stars: ✭ 38 (-68.6%)
Mutual labels:  color
uchroma
An advanced driver for Razer Chroma hardware in Linux
Stars: ✭ 45 (-62.81%)
Mutual labels:  color
farbvelo
"Random" color palette generator, cycles
Stars: ✭ 52 (-57.02%)
Mutual labels:  color

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].