All Projects → dreamRs → colorscale

dreamRs / colorscale

Licence: other
Create a color scale from a single color

Programming Languages

r
7636 projects
CSS
56736 projects

Projects that are alternatives of or similar to colorscale

prefixer
Prefix function with their namespace & other development tools
Stars: ✭ 131 (+63.75%)
Mutual labels:  addin, rstudio-addin
daattali.github.io
Dean Attali's website - R/Shiny Consultant
Stars: ✭ 51 (-36.25%)
Mutual labels:  shiny
TitlebarZ
A simple titlebar customizer for Windows 10.
Stars: ✭ 21 (-73.75%)
Mutual labels:  color
color-alpha
Change alpha of a color string
Stars: ✭ 19 (-76.25%)
Mutual labels:  color
standard-components
A specification for functional UI components
Stars: ✭ 52 (-35%)
Mutual labels:  color
theme-ui-native
Build consistent, themeable React Native apps based on constraint-based design principles
Stars: ✭ 67 (-16.25%)
Mutual labels:  color
pushbar
🖥️ Off-canvas elements for Shiny
Stars: ✭ 59 (-26.25%)
Mutual labels:  shiny
react-native-color-panel
React Native Color Panel Component for iOS and Android 🏳️‍🌈
Stars: ✭ 21 (-73.75%)
Mutual labels:  color
odak
🔬 Scientific computing library for optics 🔭, computer graphics 💻 and visual perception 👀
Stars: ✭ 99 (+23.75%)
Mutual labels:  color
ichiColor
Full features javascript color parser module, perfect work with vue.js; support RGB, HSL, HSV/HSB, HSL255, HSL240, HWB, XYZ, LAB, LUV, LHCab, xyY...
Stars: ✭ 23 (-71.25%)
Mutual labels:  color
jsTreeR
A wrapper of the jQuery plugin `jsTree`.
Stars: ✭ 36 (-55%)
Mutual labels:  shiny
customer-tracker
R data products: Reports, Presentations, Apps, and API's
Stars: ✭ 19 (-76.25%)
Mutual labels:  shiny
react-native-image-color-picker
Image color picker based on image source provided and return image different color palettes or average color palette
Stars: ✭ 25 (-68.75%)
Mutual labels:  color
color-parse
Color string parser
Stars: ✭ 44 (-45%)
Mutual labels:  color
nord-atom-syntax
An arctic, north-bluish clean and elegant Atom syntax theme.
Stars: ✭ 72 (-10%)
Mutual labels:  color
colors
A gorgeous, accessible color system.
Stars: ✭ 748 (+835%)
Mutual labels:  color
rAmCharts4
An R interface to amCharts 4
Stars: ✭ 26 (-67.5%)
Mutual labels:  shiny
TCC-GUI
📊 Graphical User Interface for TCC package
Stars: ✭ 35 (-56.25%)
Mutual labels:  shiny
ViewColorGenerator
A library to generate color palette for view, imageview and image from URL.
Stars: ✭ 29 (-63.75%)
Mutual labels:  color
goterminal
A cross-platform Go-library for updating progress in terminal.
Stars: ✭ 56 (-30%)
Mutual labels:  color

colorscale

R6 api for chroma.js & an RStudio add-in to create a color scale from a single color.

Lifecycle: experimental R build status Travis build status

Installation

Install development version from GitHub with:

remotes::install_github("dreamRs/colorscale")

RStudio add-in

An add-in to create a color palette from a single color (largely inspired by https://github.com/hihayk/scale).

To launch the gadget use the "Addins" menu in RStudio or:

colorscale::addin_color_scale()

chroma.js API

Create a R6 class to access chroma.js methods:

library(colorscale)

ch <- chroma$new("hotpink")
ch$darken(2)
ch$eval()
#> [1] "#930058"

hsl <- chroma$new()
hsl$chroma.hsl(330, 1, 0.6)
view_cols(hsl$eval())
hsl$darken(seq(0.2, 3, 0.2))
view_cols(hsl$eval())

Some methods have wrapper for easier use:

# Mixes two colors
chroma_mix(color1 = "red", color2 = "blue")
#> [1] "#800080"

# Average between colors
chroma_avg(colors = c("#ddd", "yellow", "red", "teal"))
#> [1] "#b79757"

# Random colors
chroma_random()
#> [1] "#650a0c"
chroma_random(10)
#> [1] "#63e24b" "#909363" "#5a3d7d" "#41a505" "#8f5f13" "#df6535" "#da43d3" "#04fc8f" "#6ee31c" "#ac5c94"

# Euclidean distance between two colors
chroma_distance("#fff", "#ff0")
#> [1] 96.94758
chroma_distance("#fff", "#ff0", "rgb")
#> [1] 255

Convert color to specific color space:

ch <- chroma$new("orange")
ch$hex()
#> [1] "#ffa500"
ch$rgb()
#> [1] 255 165   0
ch$hsl()
#> [1] 38.82353  1.00000  0.50000
ch$lab()
#> [1] 74.93565 23.93317 78.94978
ch$gl()
#> [1] 1.0000000 0.6470588 0.0000000 1.0000000
ch$css()
#> [1] "rgb(255,165,0)"
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].