# postcss-colour-functions

> PostCSS plugin with some useful, Sass-like colour functions

Latest version **1.5.2** (published 2017-01-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-colour-functions
pnpm add postcss-colour-functions
yarn add postcss-colour-functions
bun add postcss-colour-functions
```

## 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 | 1.5.2 |
| Published | 2017-01-17 |
| First published | 2016-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| Author | Byron Houwens |
| Maintainers | bhouwens |
| Keywords | postcss, sass |

## Links

- npm: https://www.npmjs.com/package/postcss-colour-functions
- npm.io page: https://npm.io/package/postcss-colour-functions

## Dependencies (1)

- [postcss](https://npm.io/package/postcss.md) ^5.0.19

## Recent versions

- 1.5.2 (latest) — 2017-01-17
- 1.5.1 — 2016-05-10
- 1.5.0 — 2016-04-12
- 1.4.4 — 2016-04-09
- 1.4.3 — 2016-04-09
- 1.4.2 — 2016-04-07
- 1.4.1 — 2016-03-31
- 1.4.0 — 2016-03-31
- 1.3.0 — 2016-03-30
- 1.2.0 — 2016-03-30
- 1.1.2 — 2016-03-30
- 1.1.1 — 2016-03-30
- 1.1.0 — 2016-03-30
- 1.0.3 — 2016-03-30

## README

# postcss-colour-functions

[![Packagist](https://img.shields.io/packagist/l/doctrine/orm.svg)]()
[![downloads](https://img.shields.io/badge/downloads-500%2FM-green.svg)]()

PostCSS plugin for Sass-like colour functions.

.. 

## Install

    npm install postcss-colour-functions --save

Then just require it in whatever task runner you prefer like so:

```javascript
var colourFunctions = require('postcss-colour-functions');
```

..

## Colour Functions

The plugin expects colours to be entered in either RGB/A or hexidecimal format. No HSL is usable as yet. It does also accept some basic CSS colour codes, but the list is by no means exhaustive. 

### darken

Darkens a colour by a specific amount, specified either as a decimal or percentage:

```css
/* so this */
.element{
    color: darken(#00b, 20%); // you could also use '0.2' instead of '20%'
}
    
/* becomes this */
.element{
    color: rgb(0,0,150);
}
```

### lighten

The same as `darken`, except it tints the colour as opposed to shading it:

```css
/* so this */
.element{
    color: lighten(#00b, 20%); // you could also use '0.2' instead of '20%'
}
    
/* becomes this */
.element{
    color: rgb(51,51,201);
}
```
    
### opacity

Specify an opacity for a given colour. This returns an `rgba` value:

```css
/* so this */
.element{
    color: opacity(#00b, 20%); // you could also use '0.2' instead of '20%'
}

/* becomes this */
.element{
    color: rgba(0,0,187,0.2);
}
```
    
..

## License

MIT

If you have any improvements I'm super keen to pull them in.

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