npm

Join us for the upcoming webinar, "Enterprise JavaScript done right: the tools you love, the security you need."Sign up here »

color-matrix

0.0.2 • Public • Published

color-matrix

NPM version Build Status Code Climate Dependency Status devDependency Status

NPM

Description

Apply filters to colors to simulate things like color blindness and night vision. This library tries to simulate the behavior of the svg filter effect feColorMatrix.

It comes in 2 formats: a node.js library and a command line tool.

Examples

Usage and output examples can be found here:

Node.js Library

Getting Started

Install the module with: npm install color-matrix

var ColorMatrix = require('color-matrix').ColorMatrix;
var matrix = new ColorMatrix();
// simulate color-blindness
matrix.transform([222, 0, 173, 255], 'deuteranopia'); // returns [139, 155, 121, 1]

NOTE: For a better "color blindness" library, see: color-blind. This library is just a port of the old "color matrix" code for use in node. It does allow you to pass in custom filters (which is why I published it, instead of throwing it away).

API Documentation

Read the API Docs by using this link:

Command Line Tool

Installation

The color-matrix tool can be installed globally by running:

npm install -g color-matrix

Usage

  Usage: color-matrix [options] <inputColor>
 
  Options:
 
    -h, --help                 output usage information
    -V, --version              output the version number
    -i, --input <imageFile>    input image file
    -o, --output <imageFile>   output image file
    -f, --filter <filterName>  filter name to use
    -v, --value <value>        value for the selected operation type
    -l, --list                 list all the filter names

See Also

License

Copyright (c) 2014 skratchdot
Licensed under the MIT license.

install

npm i color-matrix

Downloadsweekly downloads

8

version

0.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability