3.0.0 • Published 8 months ago

color-rgba v3.0.0

Weekly downloads
131,287
License
MIT
Repository
github
Last release
8 months ago

color-rgba test 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

@doggistyle/library@team-reflect/pixi-graphol@everything-registry/sub-chunk-1355@yutahaga/wp-vue-config@zalastax/nolb-color-freshplotly@youkuohao/microfrontendgl-componentgl-spectrumarx-level-generator@americana/maplibre-shield-generator@superdyzio/plotly.js@zsnout/tailwind@uoa-eresearch/plotly.jsface-extractorax-gisinula-chartscanvas-contributioncandy-moon-enginehexo-renderer-ruby-sassibuki.tsibukidombootstrap-jss@crunchr/plotly.jscode-in-designcode-in-design-system@infinitebrahmanuniverse/nolb-color-udt-to-cvatudt-to-pngudt-to-yolounitransformdoggistylespritejstoughviettest1111.js@public-ui/schema@solsmk/graphiclab@pycord/discord-message-components-core@img-arena/img-ui-mui-theme@img-arena/ui-core@magic-circle/controls@master/css-language-service@moonmoonbrothers/flutterjs@mesh.js/core@meursyphus/flitter@kausal/plotly-custom@pfis1737/hexo-renderer-sass@newcrom/plotly.js@spritejs/next@react-theming/flatten@labelu/annotation@labelwu/lb-annotation@labelbee/lb-annotation@muros-ct/plotly.js@napolab/alpha-blend@laszlolm/pixi-graph@dhilt/plotly.jscolor-normalize@discord-message-components/core@discord-components/core@doggistyle/sassissamovitch_chartsgraphiclabkpmp-custom-plotly.jscustom-plotly.jspynab.jsmicrofrontend-chartjsloupedeckloupedeck-controllerdomsipixi-graphpixi-graph-forkpixi-graphsmooth-forkdocsify-highlightnative-canvasdashbot_plotly.jsplotly.js-esmplotly.js-fix2plotly.js-with-localesplot-gridplotly.jsplotly.js-cartesian-esmopenstreetmap-americanareact-voodooreact-voodoo-tweener@giliweb/plotly.jsreact-rtweenreact-schedule-meeting-german@hfribeiro/ska-plotly@gridal/f-gridalyform@giangtong/plotly.js@hangkan/hkcim@hangkan/hzcimregl-scatter2d@hoangho1147/hoang-sankey-plotly@hzcim/hzcimol-mapping-library
3.0.0

8 months ago

2.4.0

2 years ago

2.3.0

3 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.1

5 years ago

2.1.0

6 years ago

2.0.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago