Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

color manipulation R package Simply and Tidy

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
NotificationsYou must be signed in to change notification settings

EmilHvitfeldt/prismatic

Repository files navigation

R-CMD-checkCodecov test coverageCRAN statusDownloadsLifecycle: stableDOI

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

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

Installation

You can install the released version of prismatic fromCRAN with:

install.packages("prismatic")

And the development version fromGitHub with:

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

Examples

Allprismatic function return acolors object, which includes anew printing method and plotting method for quickly visualizing thecolors.

library(prismatic)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 #F2F2F2FFplot(terrain_color)

Ifcli is available the print methodwill do its best to represent the colors.

ddd<- color(terrain.colors(10))ddd#> <colors>#> #00A600FF #2DB600FF #63C600FF #A0D600FF #E6E600FF #E8C32EFF #EBB25EFF #EDB48EFF #F0C9C0FF #F2F2F2FFplot(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 libraryQix-/color.

Code of Conduct

Please note that theprismatic project is released with aContributor Code ofConduct.By contributing to this project, you agree to abide by its terms.

About

color manipulation R package Simply and Tidy

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp