Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

color-space

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-space - npm Package Compare versions

Comparing version 1.6.0 to 1.7.0

1

index.js

@@ -23,2 +23,3 @@ /**

ydbdr: require('./ydbdr'),
ypbpr: require('./ypbpr'),
lab: require('./lab'),

@@ -25,0 +26,0 @@ labh: require('./labh'),

2

package.json
{
"name": "color-space",
"description": "Color space conversions and data",
"version": "1.6.0",
"version": "1.7.0",
"author": "Deema Yvanow <dfcreative@gmail.com>",

@@ -6,0 +6,0 @@ "keywords": [

@@ -10,3 +10,3 @@ # Color-space [![Build Status](https://travis-ci.org/dfcreative/color-space.svg?branch=master)](https://travis-ci.org/dfcreative/color-space) [![Code Climate](https://codeclimate.com/github/dfcreative/color-space/badges/gpa.svg)](https://codeclimate.com/github/dfcreative/color-space) [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[![npm install color-space](https://nodei.co/npm/color-space.png?mini=true)](https://npmjs.org/package/color-space/)
[`npm install color-space`](https://npmjs.org/package/color-space/)

@@ -20,3 +20,3 @@ ```js

Require separately:
You can require a separate space to reduce size significantly:

@@ -65,3 +65,3 @@ ```js

* [x] [YDbDr](https://en.wikipedia.org/wiki/YDbDr)
* [ ] [YPbPr](https://en.wikipedia.org/wiki/YPbPr)
* [x] [YPbPr](https://en.wikipedia.org/wiki/YPbPr)
* [ ] [YCbCr](https://en.wikipedia.org/wiki/YCbCr)

@@ -68,0 +68,0 @@ * [ ] [YCgCo](https://en.wikipedia.org/wiki/YCgCo)

/**
* https://en.wikipedia.org/?title=YPbPr
*
* HDTV conversion is used
*
* @module color-space/ypbpr

@@ -11,6 +13,6 @@ */

name: 'ypbpr',
min: [0,-0.5,-0.5],
max: [1, 0.5, 0.5],
min: [0,-1.333,-1.333],
max: [1, 1.333, 1.333],
channel: ['Y','Pb','Pr'],
alias: ['YPbPr']
alias: ['YPbPr', 'Y/PB/PR', 'YPRPB', 'PRPBY', 'PBPRY', 'Y/Pb/Pr', 'YPrPb', 'PrPbY', 'PbPrY', 'Y/R-Y/B-Y', 'Y(R-Y)(B-Y)', 'R-Y', 'B-Y']
};

@@ -27,3 +29,13 @@

ypbpr.rgb = function(ypbpr) {
var y = ypbpr[0], pb = ypbpr[1], pr = ypbpr[2];
var r = pr + y;
var b = pb + y;
var g = (y - 0.2126*r - 0.0722*b) / 0.7152;
return [
r * 255,
g * 255,
b * 255
];
};

@@ -40,3 +52,11 @@

rgb.ypbpr = function(rgb) {
var r = rgb[0]/255, g = rgb[1]/255, b = rgb[2]/255;
var y = 0.2126 * r + 0.7152 * g + 0.0722 * b;
return [
y,
b - y,
r - y
];
};
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