# postcss-color-rgb

> PostCSS plugin to transform W3C CSS Color Module Level 4 rgb() new syntax to more compatible CSS (comma-separated rgb() or rgba())

Latest version **2.0.0** (published 2017-05-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-color-rgb
pnpm add postcss-color-rgb
yarn add postcss-color-rgb
bun add postcss-color-rgb
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-05-25 |
| First published | 2016-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 11 |
| Author | David Marchena |
| Maintainers | dmarchena |
| Keywords | postcss, css, postcss-plugin, color, rgb, rgba |

## Links

- npm: https://www.npmjs.com/package/postcss-color-rgb
- Repository: https://github.com/dmarchena/postcss-color-rgb
- Issues: https://github.com/dmarchena/postcss-color-rgb/issues
- npm.io page: https://npm.io/package/postcss-color-rgb

## Dependencies (2)

- [postcss](https://npm.io/package/postcss.md) ^6.0.1
- [postcss-value-parser](https://npm.io/package/postcss-value-parser.md) ^3.3.0

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2017-05-25
- 1.1.4 — 2016-11-16
- 1.1.3 — 2016-11-16
- 1.1.2 — 2016-11-14
- 1.1.1 — 2016-11-13
- 1.1.0 — 2016-11-11
- 1.0.0 — 2016-11-10

## README

# PostCSS Color Rgb [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov]

[PostCSS] plugin to transform [W3C CSS Color Module Level 4 rgb()](https://drafts.csswg.org/css-color/#funcdef-rgb) new syntax to more compatible CSS (comma-separated rgb() or rgba()).

[PostCSS]: https://github.com/postcss/postcss
[ci-img]:  https://travis-ci.org/dmarchena/postcss-color-rgb.svg
[ci]:      https://travis-ci.org/dmarchena/postcss-color-rgb
[cov-img]: https://coveralls.io/repos/github/dmarchena/postcss-color-rgb/badge.svg
[cov]:     https://coveralls.io/github/dmarchena/postcss-color-rgb

## CSS Colors 4 syntax

```
rgb() = rgb( <percentage>{3} [ / <alpha-value> ]? ) |
        rgb( <number>{3} [ / <alpha-value> ]? )

<alpha-value> = <number> | <percentage>
```

## CSS Colors 3 syntax (actual)

```
rgb() = rgb( <percentage>#{3}) |
        rgb( <integer>#{3})

rgba() = rgba( <percentage>#{3} , <alpha-value> ) |
         rgba( <integer>#{3} , <alpha-value> )

<alpha-value> = <number>
```

## Example

```css
.foo {
  /* Input example */
  color: rgb(250.5 255 255);
  background-image: linear-gradient(to bottom right, rgb(10% 11% 12% / 90%), rgb(23% 24% 25% / .5));
}
```

```css
.foo {
  /* Output example */
  color: rgb(251, 255, 255);
  background-image: linear-gradient(to bottom right, rgba(10%, 11%, 12%, .9), rgba(23%, 24%, 25%, .5));
}
```

## Usage

```js
postcss([ require('postcss-color-rgb') ])
```

See [PostCSS] docs for examples for your environment.

---
_Source: https://npm.io/package/postcss-color-rgb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
