color-rgba

WebJar for color-rgba

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

color-rgba
Last Version

Last Version

2.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

color-rgba
WebJar for color-rgba
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

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

Download color-rgba

How to add to project

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

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : clamp jar [1.0.1,2)
org.webjars.npm : color-parse jar [1.3.8,2)
org.webjars.npm : color-space jar [1.14.6,2)

Project Modules

There are no modules declared in this project.

color-rgba Build Status size stable

Convert color string to array with rgba channel values: "rgba(127,127,127,.1)"[127,127,127,.1].

Usage

npm install color-rgba

const rgba = require('color-rgba')

rgba('red') // [255, 0, 0, 1]
rgba('rgb(80, 120, 160)') // [80, 120, 160, 1]
rgba('rgba(80, 120, 160, .5)') // [80, 120, 160, .5]
rgba('hsla(109, 50%, 50%, .75)') // [87.125, 191.25, 63.75, .75]
rgba`rgb(80 120, 160 / 50%)` // [80, 120, 160, .5]

API

let [r, g, b, alpha] = rgba(color)

Returns channels values as they are in the input color string argument. alpha is always from 0..1 range. color can be a CSS color string, an array with channel values, an object etc., see color-parse.

Related

License

(c) 2017 Dima Yv. MIT License

org.webjars.npm

color.js

Color in JavaScript

Versions

Version
2.1.1
2.1.0
2.0.0