Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
This gem randomly generates very distinct colors with consistent lightness and saturation.
If you are using these colors as background colors, consistent lightness lets you use the same foreground color for each. Consistent saturation lets you avoid mixing pastels with vibrant colors, etc.
require 'color-generator'
Generate colors using the HSL color representation:
generator = ColorGenerator.new saturation: 0.3, lightness: 0.75
color1 = generator.create_hex
# => "cfd2ac"
color2 = generator.create_hex
# => "cbacd2"
Generate colors using the HSV color representation:
generator = ColorGenerator.new saturation: 0.3, value: 1.0
color1 = generator.create_hex
# => "f7b3ff"
color2 = generator.create_hex
# => "b3ffe0"
If you want to make color generation repeatable, set a seed for the pseudorandom number generator:
generator = ColorGenerator.new saturation: 0.3, value: 1.0, seed: 12345
If you prefer a decimal RGB value, call create_rgb
instead of create_hex
.
Thanks to Martin Ankerl for his blog post which inspired this gem.
This gem's main repository is on GitHub: http://github.com/opennorth/color-generator, where your contributions, forks, bug reports, feature requests, and feedback are greatly welcomed.
Copyright (c) 2012 Open North Inc., released under the MIT license
FAQs
Unknown package
We found that color-generator 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.