{"id":16731417,"url":"https://github.com/skratchdot/color-matrix","last_synced_at":"2025-03-23T15:31:00.029Z","repository":{"id":57203287,"uuid":"43582044","full_name":"skratchdot/color-matrix","owner":"skratchdot","description":"Apply filters to colors to simulate things like color blindness and night vision.","archived":false,"fork":false,"pushed_at":"2016-09-21T05:48:48.000Z","size":18099,"stargazers_count":24,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T21:50:51.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skratchdot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-03T00:10:56.000Z","updated_at":"2024-11-22T15:29:10.000Z","dependencies_parsed_at":"2022-09-17T00:21:25.759Z","dependency_job_id":null,"html_url":"https://github.com/skratchdot/color-matrix","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fcolor-matrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fcolor-matrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fcolor-matrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fcolor-matrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skratchdot","download_url":"https://codeload.github.com/skratchdot/color-matrix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245122677,"owners_count":20564355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T23:37:02.735Z","updated_at":"2025-03-23T15:30:59.603Z","avatar_url":"https://github.com/skratchdot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# color-matrix\n\n[![NPM version](https://badge.fury.io/js/color-matrix.svg)](http://badge.fury.io/js/color-matrix)\n[![Build Status](https://travis-ci.org/skratchdot/color-matrix.png?branch=master)](https://travis-ci.org/skratchdot/color-matrix)\n[![Code Climate](https://codeclimate.com/github/skratchdot/color-matrix.png)](https://codeclimate.com/github/skratchdot/color-matrix)\n[![Dependency Status](https://david-dm.org/skratchdot/color-matrix.svg)](https://david-dm.org/skratchdot/color-matrix)\n[![devDependency Status](https://david-dm.org/skratchdot/color-matrix/dev-status.svg)](https://david-dm.org/skratchdot/color-matrix#info=devDependencies)\n\n[![NPM](https://nodei.co/npm/color-matrix.png)](https://npmjs.org/package/color-matrix)\n\n\n## Description\n\nApply filters to colors to simulate things like color blindness and night vision. This\nlibrary tries to simulate the behavior of the svg filter effect \n[feColorMatrix](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feColorMatrix).\n\nIt comes in 2 formats: [a node.js library](#getting-started) and a\n[command line tool](#command-line-tool).\n\n\n## Examples\n\nUsage and output examples can be found here:\n\n- http://projects.skratchdot.com/color-matrix/examples.html\n\n\n## Node.js Library\n\n### Getting Started\n\nInstall the module with: `npm install color-matrix`\n\n```javascript\nvar ColorMatrix = require('color-matrix').ColorMatrix;\nvar matrix = new ColorMatrix();\n// simulate color-blindness\nmatrix.transform([222, 0, 173, 255], 'deuteranopia'); // returns [139, 155, 121, 1]\n```\n\n***NOTE:*** For a better \"color blindness\" library, see:\n[color-blind](http://github.com/skratchdot/color-blind). This library is just a port\nof the old \"color matrix\" code for use in node.  It does allow you to pass in custom\nfilters (which is why I published it, instead of throwing it away).\n\n\n### API Documentation\n\nRead the [API Docs](http://projects.skratchdot.com/color-matrix/api.html)\nby using this link:\n\n- http://projects.skratchdot.com/color-matrix/api.html\n\n\n## Command Line Tool\n\n\n### Installation\n\nThe `color-matrix` tool can be installed globally by running:\n```bash\nnpm install -g color-matrix\n```\n\n### Usage\n\n```bash\n  Usage: color-matrix [options] \u003cinputColor\u003e\n\n  Options:\n\n    -h, --help                 output usage information\n    -V, --version              output the version number\n    -i, --input \u003cimageFile\u003e    input image file\n    -o, --output \u003cimageFile\u003e   output image file\n    -f, --filter \u003cfilterName\u003e  filter name to use\n    -v, --value \u003cvalue\u003e        value for the selected operation type\n    -l, --list                 list all the filter names\n```\n\n\n## See Also\n\n- [MDN: feColorMatrix](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feColorMatrix)\n- [w3c spec: feColorMatrix](http://www.w3.org/TR/SVG/filters.html#feColorMatrixElement)\n- [color-js source code](https://color-js.googlecode.com/svn/trunk/src/Color.matrix.js)\n- [Original Color Matrix Library](http://web.archive.org/web/20081014161121/http://www.colorjack.com/labs/colormatrix/)\n- [StackOverflow: RGB filters for different forms of color blindness](http://stackoverflow.com/questions/87146/rgb-filters-for-different-forms-of-color-blindness)\n- [Fun with the colormatrix](http://hirntier.blogspot.com/2008/09/fun-with-colormatrix.html)\n\n\n## License\n\nCopyright (c) 2014 skratchdot  \nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Fcolor-matrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskratchdot%2Fcolor-matrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Fcolor-matrix/lists"}