{"id":16731420,"url":"https://github.com/skratchdot/color-harmony","last_synced_at":"2025-07-09T12:12:19.036Z","repository":{"id":57203266,"uuid":"21081464","full_name":"skratchdot/color-harmony","owner":"skratchdot","description":"Create color scales by rotating hue","archived":false,"fork":false,"pushed_at":"2016-08-28T10:49:29.000Z","size":11,"stargazers_count":85,"open_issues_count":4,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-14T09:43:34.257Z","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":"2014-06-21T23:54:33.000Z","updated_at":"2024-10-23T21:09:58.000Z","dependencies_parsed_at":"2022-09-17T00:50:40.088Z","dependency_job_id":null,"html_url":"https://github.com/skratchdot/color-harmony","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/skratchdot/color-harmony","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fcolor-harmony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fcolor-harmony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fcolor-harmony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fcolor-harmony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skratchdot","download_url":"https://codeload.github.com/skratchdot/color-harmony/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fcolor-harmony/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261853194,"owners_count":23219820,"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.838Z","updated_at":"2025-07-09T12:12:19.021Z","avatar_url":"https://github.com/skratchdot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# color-harmony\n\n[![NPM version](https://badge.fury.io/js/color-harmony.svg)](http://badge.fury.io/js/color-harmony)\n[![Build Status](https://travis-ci.org/skratchdot/color-harmony.png?branch=master)](https://travis-ci.org/skratchdot/color-harmony)\n[![Code Climate](https://codeclimate.com/github/skratchdot/color-harmony.png)](https://codeclimate.com/github/skratchdot/color-harmony)\n[![Coverage Status](https://coveralls.io/repos/skratchdot/color-harmony/badge.png)](https://coveralls.io/r/skratchdot/color-harmony)\n[![Dependency Status](https://david-dm.org/skratchdot/color-harmony.svg)](https://david-dm.org/skratchdot/color-harmony)\n[![devDependency Status](https://david-dm.org/skratchdot/color-harmony/dev-status.svg)](https://david-dm.org/skratchdot/color-harmony#info=devDependencies)\n\n[![NPM](https://nodei.co/npm/color-harmony.png)](https://npmjs.org/package/color-harmony)\n\n\n## Description\n\nA javascript library that creates color scales/harmonies by rotating the hue of the given color.\n\nThere are also helper methods to create shades (mixing w/ black), tints (mixing w/ white), and\ntones (mixing w/ middle gray).\n\n\n## Getting Started\n\nInstall the module with: `npm install color-harmony`\n\n```javascript\nvar Harmonizer = require('color-harmony').Harmonizer;\nvar harmonizer = new Harmonizer();\nharmonizer.harmonizeAll('#c820f1'); // returns a map of scales\nharmonizer.harmonize('#000', 'complementary'); // returns ['#000000', '#ffffff']\n```\n\n\n## Documentation\n\nThis library uses the [onecolor](https://github.com/One-com/one-color) parser,\nso colorString can in many different formats (i.e. #ff00cc, rgb(13,42,255), etc).\n\n#### harmonizer.add(harmonyName, degreeArray)\n\nAdd a new named harmony. If the harmony name already exists, it will\nbe overwritten.  If degreeArray is not an array of numbers, then the\nharmony will not be added.\n\n#### harmonizer.harmonizeAll(colorString)\n\nReturn a map of all the harmonies for the given color string.\n\n#### harmonizer.harmonize(colorString, harmony)\n\nReturn an array of hex codes based on the given color string and harmony.\n\nThe harmony argument can be a 'named harmony', or it can be a custom harmony\nby passing in an array of numbers (degrees 0-360).\n\n#### harmonizer.shades(colorString, size)\n\nReturn an array of hex codes container the shades of a given color (i.e. mix it with black - #000000).\n\nIf size is not a valid number, then the array will default to a size of 10.\n\n#### harmonizer.tints(colorString, size)\n\nReturn an array of hex codes container the tints of a given color (i.e. mix it with white - #FFFFFF).\n\nIf size is not a valid number, then the array will default to a size of 10.\n\n#### harmonizer.tones(colorString, size)\n\nReturn an array of hex codes container the tones of a given color (i.e. mix it with middle gray - #777777).\n\nIf size is not a valid number, then the array will default to a size of 10.\n\n### Available Harmony Names (and their associated degrees of hue rotation)\n\n- complementary: [0,180]\n- splitComplementary: [0,150,320]\n- splitComplementaryCW: [0,150,300]\n- splitComplementaryCCW: [0,60,210]\n- triadic: [0,120,240]\n- clash: [0,90,270]\n- tetradic: [0,90,180,270]\n- fourToneCW: [0,60,180,240]\n- fourToneCCW: [0,120,180,300]\n- fiveToneA: [0,115,155,205,245]\n- fiveToneB: [0,40,90,130,245]\n- fiveToneC: [0,50,90,205,320]\n- fiveToneD: [0,40,155,270,310]\n- fiveToneE: [0,115,230,270,320]\n- sixToneCW: [0,30,120,150,240,270]\n- sixToneCCW: [0,90,120,210,240,330]\n- neutral: [0,15,30,45,60,75]\n- analogous: [0,30,60,90,120,150]\n\n**NOTE:** This list was compiled based on the data in [color-js](https://github.com/brehaut/color-js)\n\n\n## Examples\n\nGet all the stored harmonies\n```javascript\nharmonizer.harmonizeAll('#c820f1'); // returns a map of scales\n```\n\nGet a named harmony\n```javascript\nharmonizer.harmonize('#000', 'complementary'); // returns ['#000000', '#ffffff']\n```\n\nGet a custom harmony\n```javascript\nharmonizer.harmonize('#000', [0, 10, 20, 30, 40]); // returns an array of colors\n```\n\nAdd a custom harmony that can later be referenced by name\n```javascript\nharmonizer.add('foo', [0, 25, 45]);\nharmonizer.harmonize('#00cc00', 'foo'); // returns your custom data\n```\n\nReturn the shades of a given color (mix it with black - #000000)\n```javascript\nharmonizer.shades('#925719'); // returns 10 by default\nharmonizer.shades('#925719', 14); // you can return a custom amount (an array of 14)\n```\n\nReturn the tints of a given color (mix it with white - #FFFFFF)\n```javascript\nharmonizer.tints('#925719'); // returns 10 by default\nharmonizer.tints('#925719', 14); // you can return a custom amount (an array of 14)\n```\n\nReturn the tones of a given color (mix it with middle gray - #777777)\n```javascript\nharmonizer.tones('#925719'); // returns 10 by default\nharmonizer.tones('#925719', 14); // you can return a custom amount (an array of 14)\n```\n\n\n## Release History\n\n#### v0.2.0 - Released June 22, 2014\n\n- fixing a bug with the saturation value that was being used\n\n#### v0.1.0 - Released June 21, 2014\n\n- initial release\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-harmony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskratchdot%2Fcolor-harmony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Fcolor-harmony/lists"}