3.0.0 • Published 2 years ago

color-rgba v3.0.0

Weekly downloads
131,287
License
MIT
Repository
github
Last release
2 years 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-graph@everything-registry/sub-chunk-1355@discord-message-components/core@discord-components/core@doggistyle/sassissamovitch_chartsspritejsudt-to-cvatudt-to-pngudt-to-yolotough@americana/maplibre-shield-generator@dhilt/plotly.js@crunchr/plotly.jswebgis-apiviettest1111.jsunitransformunocss-language-server@gridal/f-gridalyform@hangkan/hkcim@hangkan/hzcim@hoangho1147/hoang-sankey-plotly@hfribeiro/ska-plotly@giliweb/plotly.js@giangtong/plotly.js@infinitebrahmanuniverse/nolb-color-@labelbee/lb-annotation@labelu/annotation@labelwu/lb-annotation@laszlolm/pixi-graph@magic-circle/controls@meursyphus/flitter@muros-ct/plotly.js@master/css-language-service@newcrom/plotly.js@napolab/alpha-blend@mesh.js/core@kausal/plotly-custom@img-arena/img-ui-mui-theme@img-arena/ui-core@hzcim/hzcim@moonmoonbrothers/flutterjs@react-theming/flatten@pycord/discord-message-components-core@pfis1737/hexo-renderer-sass@spritejs/next@solsmk/graphiclab@sigtuple/olmicrofrontend-chartjsnative-canvasopenstreetmap-americanaol-mapping-libraryocmapobsidian-pieces-pluginpynab.jsreact-native-photo-manipulatorpixi-graphsmooth-forkpixi-graphpixi-graph-forkplotly.jsplot-gridplotly.js-with-localesplotly.js-esmplotly.js-cartesian-esmplotly.js-fix2regl-scatter2dreact-schedule-meeting-germansheet-happensreact-rtweenreact-voodoo-tweenerreact-voodoogl-componentgl-spectrum@zsnout/tailwind@zalastax/nolb-color-@yutahaga/wp-vue-config@youkuohao/microfrontend@xtayaitak/react-native-photo-manipulatoradvanced-chartscustom-plotly.jsdashbot_plotly.jscode-in-designcode-in-design-systemcolor-normalizecid-module-systemcanvas-contributiondoggistyledocsify-highlightdomsiibukidomibuki.tsgraphiclabhexo-renderer-ruby-sassinula-chartsloupedeckloupedeck-controllerkpmp-custom-plotly.js@superdyzio/plotly.js@uoa-eresearch/plotly.js
3.0.0

2 years ago

2.4.0

3 years ago

2.3.0

4 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.1

6 years ago

2.1.0

7 years ago

2.0.0

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago