Socket
Socket
Sign inDemoInstall

culori

Package Overview
Dependencies
Maintainers
5
Versions
256
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

culori - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

4

CHANGELOG.md
## Culori Changelog
### 0.8.0
Adds `culori.blend()` ([#59](https://github.com/Evercoder/culori/issues/59)).
### 0.7.4

@@ -4,0 +8,0 @@

2

package.json
{
"name": "culori",
"version": "0.8.0",
"version": "0.8.1",
"main": "build/culori.umd.js",

@@ -5,0 +5,0 @@ "browser": "build/culori.umd.js",

@@ -88,3 +88,3 @@ # Culori

- [Difference](#difference)
- [Blending](#blending)
- [Blending](#blending)
- [Extending culori](#extending-culori)

@@ -423,27 +423,35 @@

* `normal`
* `multiply`
* `screen`
* `hard-light`
* `overlay`
* `darken`
* `lighten`
* `color-dodge`
* `color-burn`
* `soft-light`
* `difference`
* `exclusion`
- `normal`
- `multiply`
- `screen`
- `hard-light`
- `overlay`
- `darken`
- `lighten`
- `color-dodge`
- `color-burn`
- `soft-light`
- `difference`
- `exclusion`
> **Note:** culori currently implements the _separable_ blend modes, that is the blend modes that work on each channel in the color space independently. _color_, _hue_, _saturation_, and _lightness_ modes are not yet available.
An example of blending three colors:
```js
culori.blend(
[
'rgba(255, 0, 0, 0.5)',
'rgba(0, 255, 0, 0.5)',
'rgba(0, 0, 255, 0.5)',
],
['rgba(255, 0, 0, 0.5)', 'rgba(0, 255, 0, 0.5)', 'rgba(0, 0, 255, 0.5)'],
'screen'
)
);
// => { mode: 'rgb', alpha: 0.875, r: 0.57..., g: 0.57..., b:0.57... }
```
In addition to strings, the _type_ parameter supports a _function (b, s) → v_ that takes the values of the _backdrop_ and _source_ color to return the blended value. This allows you to write your own (separable) blending functions. For example, an _average_ blending mode:
```js
culori.blend(['red', 'green'], function average(b, s) {
return (b + s) / 2;
});
```
### Extending culori

@@ -450,0 +458,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc