Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
color-harmony
Advanced tools
A javascript library that creates color scales/harmonies by rotating the hue of the given color.
There are also helper methods to create shades (mixing w/ black), tints (mixing w/ white), and tones (mixing w/ middle gray).
Install the module with: npm install color-harmony
var Harmonizer = require('color-harmony').Harmonizer;
var harmonizer = new Harmonizer();
harmonizer.harmonizeAll('#c820f1'); // returns a map of scales
harmonizer.harmonize('#000', 'complementary'); // returns ['#000000', '#ffffff']
This library uses the onecolor parser, so colorString can in many different formats (i.e. #ff00cc, rgb(13,42,255), etc).
Add a new named harmony. If the harmony name already exists, it will be overwritten. If degreeArray is not an array of numbers, then the harmony will not be added.
Return a map of all the harmonies for the given color string.
Return an array of hex codes based on the given color string and harmony.
The harmony argument can be a 'named harmony', or it can be a custom harmony by passing in an array of numbers (degrees 0-360).
Return an array of hex codes container the shades of a given color (i.e. mix it with black - #000000).
If size is not a valid number, then the array will default to a size of 10.
Return an array of hex codes container the tints of a given color (i.e. mix it with white - #FFFFFF).
If size is not a valid number, then the array will default to a size of 10.
Return an array of hex codes container the tones of a given color (i.e. mix it with middle gray - #777777).
If size is not a valid number, then the array will default to a size of 10.
NOTE: This list was compiled based on the data in color-js
Get all the stored harmonies
harmonizer.harmonizeAll('#c820f1'); // returns a map of scales
Get a named harmony
harmonizer.harmonize('#000', 'complementary'); // returns ['#000000', '#ffffff']
Get a custom harmony
harmonizer.harmonize('#000', [0, 10, 20, 30, 40]); // returns an array of colors
Add a custom harmony that can later be referenced by name
harmonizer.add('foo', [0, 25, 45]);
harmonizer.harmonize('#00cc00', 'foo'); // returns your custom data
Return the shades of a given color (mix it with black - #000000)
harmonizer.shades('#925719'); // returns 10 by default
harmonizer.shades('#925719', 14); // you can return a custom amount (an array of 14)
Return the tints of a given color (mix it with white - #FFFFFF)
harmonizer.tints('#925719'); // returns 10 by default
harmonizer.tints('#925719', 14); // you can return a custom amount (an array of 14)
Return the tones of a given color (mix it with middle gray - #777777)
harmonizer.tones('#925719'); // returns 10 by default
harmonizer.tones('#925719', 14); // you can return a custom amount (an array of 14)
Copyright (c) 2014 skratchdot
Licensed under the MIT license.
FAQs
Create color scales by rotating hue
The npm package color-harmony receives a total of 771 weekly downloads. As such, color-harmony popularity was classified as not popular.
We found that color-harmony demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.