All Projects → colorjs → color-parse

colorjs / color-parse

Licence: MIT license
Color string parser

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to color-parse

color-alpha
Change alpha of a color string
Stars: ✭ 19 (-56.82%)
Mutual labels:  color, colorjs
color-rgba
Get rgba array from color string
Stars: ✭ 18 (-59.09%)
Mutual labels:  color, colorjs
color-name
A JSON with CSS color names
Stars: ✭ 72 (+63.64%)
Mutual labels:  color, colorjs
slick
Vim/Neovim Colortheme–Truecolor, Stunning, Complete
Stars: ✭ 15 (-65.91%)
Mutual labels:  color
yiq
Returns white when a color is dark and black when a color is light.
Stars: ✭ 24 (-45.45%)
Mutual labels:  color
strapless
Strapless is a color-changing CSS boilerplate for HTML elements, and a powerful LessCSS library for colors and patterns.
Stars: ✭ 27 (-38.64%)
Mutual labels:  color
colors
A gorgeous, accessible color system.
Stars: ✭ 748 (+1600%)
Mutual labels:  color
Get Childitemcolor
Add coloring to the output of Get-ChildItem Cmdlet of PowerShell.
Stars: ✭ 251 (+470.45%)
Mutual labels:  color
colocat
Fegeya Colocat, Colorized 'cat' implementation. Written in C++17.
Stars: ✭ 14 (-68.18%)
Mutual labels:  color
tc-lib-color
PHP library to manipulate various color representations
Stars: ✭ 19 (-56.82%)
Mutual labels:  color
Coulr
Color box to help developers and designers
Stars: ✭ 25 (-43.18%)
Mutual labels:  color
sshbg
Change terminal background when SSH'ing (on specific terminals)
Stars: ✭ 45 (+2.27%)
Mutual labels:  color
UIImageColorRatio
A tool to calculate the color ratio of UIImage in iOS.
Stars: ✭ 34 (-22.73%)
Mutual labels:  color
ChromaTerm
Color your Terminal with RegEx!
Stars: ✭ 149 (+238.64%)
Mutual labels:  color
use-color-change
📈📉React hook for flashing a text when a value becomes higher or lower
Stars: ✭ 32 (-27.27%)
Mutual labels:  color
Colorizeswift
Terminal string styling for Swift.
Stars: ✭ 253 (+475%)
Mutual labels:  color
sh
Collection Of My Sh Scripts.
Stars: ✭ 109 (+147.73%)
Mutual labels:  color
colorize
*nixy filter that adds color to its standard input by rows or columns
Stars: ✭ 83 (+88.64%)
Mutual labels:  color
flavours
🎨💧 An easy to use base16 scheme manager that integrates with any workflow.
Stars: ✭ 331 (+652.27%)
Mutual labels:  color
khroma
A collection of functions for manipulating CSS colors, inspired by SASS.
Stars: ✭ 28 (-36.36%)
Mutual labels:  color

color-parse build size stable

Fast and compact color string parser.

$ npm install color-parse

var parse = require('color-parse')

parse('hsla(12 10% 50% / .3)')
// { space: 'hsl', values: [12, 10, 50], alpha: 0.3 }

Parsed strings

  • Color keywords: red, green etc., see color-name
  • #RGB[A]
  • #RRGGBB[AA]
  • rgb[a](R, G, B[, A])
  • rgb[a](R G B[ / A])
  • hsl[a](H, S, L[, A]), inc. named hues
  • hsl[a](H S L [ / A])
  • hwb(H, W, B)
  • cmyk(C, M, Y, K)
  • xyz(X, Y, Z)
  • lab(L, A, B)
  • lch(L, C, H)
  • luv(L, U, V)
  • R:10 G:20 B:30
  • (R10 / G20 / B30)
  • C100/M80/Y0/K35

Parsed not strings

  • [10, 20, 20] as RGB color space
  • {r: 10, g: 20, b: 30}
  • {red: 10, green: 20, blue: 30}
  • {h: 10, s: 20, l: 30}
  • 0x00ff00, 0x0000ff numbers

Not parsed strings

  • 'yellowblue' returns null

Related

  • color-space — collection of color space conversions.
  • color-rgba — convert any color string to rgba array.
  • color-alpha — change alpha component of any color.

Analogs

  • parse-color — parser by @substack. Performs calculations to every possible space, which bloats size.
  • color-parser — parser by @tjholowaychuk. Supports limited set of spaces.
  • color-string — parsing/serializing module by Heather Arthur. Has extensive API for parsing and serializing from any to any space.

NPM

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].