color-normalize

WebJar for color-normalize

License

License

MIT
Categories

Categories

ORM Data
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

color-normalize
Last Version

Last Version

1.5.2
Release Date

Release Date

Type

Type

jar
Description

Description

color-normalize
WebJar for color-normalize
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

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

Download color-normalize

How to add to project

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

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : color-rgba jar [2.2.0,3)
org.webjars.npm : dtype jar [2.0.0,3)

Project Modules

There are no modules declared in this project.

color-normalize Build Status size stable

Convert any color argument (string, color, number, object etc.) to an array with channels data of desired output format.

Usage

npm install color-normalize

const rgba = require('color-normalize')

rgba('red') // [1, 0, 0, 1]
rgba('rgb(80, 120, 160)', 'uint8') // Uint8Array<[80, 120, 160, 255]>
rgba('rgba(255, 255, 255, .5)', 'float64') // Float64Array<[1, 1, 1, .5]>
rgba('hsla(109, 50%, 50%, .75)', 'uint8') // Uint8Array<[87, 191, 64, 191]>
rgba(new Float32Array([0, 0.25, 0, 1]), 'uint8_clamped') // Uint8ClampedArray<[0, 64, 0, 255]>
rgba(new Uint8Array([0, 72, 0, 255]), 'array') // [0, 0.2823529411764706, 0, 1]

// ambivalent input
rgba([0,0,0]) // [0,0,0]
rgba([.5,.5,.5]) // [.5,.5,.5]
rgba([1,1,1]) // [1,1,1]
rgba([127,127,127]) // [.5,.5,.5]
rgba([255,255,255]) // [1,1,1]

Output format can be any dtype: uint8, uint8_clamped, array, float32, float64 etc. By default it converts to array with 0..1 range values.

Related

License

(c) 2017 Dima Yv. MIT License

org.webjars.npm

color.js

Color in JavaScript

Versions

Version
1.5.2
1.5.0
1.3.0
1.0.3