color-parse

WebJar for color-parse

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

color-parse
Last Version

Last Version

1.3.8
Release Date

Release Date

Type

Type

jar
Description

Description

color-parse
WebJar for color-parse
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/colorjs/color-parse

Download color-parse

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/color-parse/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>color-parse</artifactId>
    <version>1.3.8</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/color-parse/
implementation 'org.webjars.npm:color-parse:1.3.8'
// https://jarcasting.com/artifacts/org.webjars.npm/color-parse/
implementation ("org.webjars.npm:color-parse:1.3.8")
'org.webjars.npm:color-parse:jar:1.3.8'
<dependency org="org.webjars.npm" name="color-parse" rev="1.3.8">
  <artifact name="color-parse" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='color-parse', version='1.3.8')
)
libraryDependencies += "org.webjars.npm" % "color-parse" % "1.3.8"
[org.webjars.npm/color-parse "1.3.8"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : color-name jar [1.0.0,2)
org.webjars.npm : defined jar [1.0.0,2)
org.webjars.npm : is-plain-obj jar [1.1.0,2)

Project Modules

There are no modules declared in this project.

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

org.webjars.npm

color.js

Color in JavaScript

Versions

Version
1.3.8
1.3.7
1.3.5