Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
colour-range
Advanced tools
Get a wide list of unique colours, based on shifting the hue of the colours
Array.<string>
Get as wide a list of unique colours as possible, based on shifting the hue of the colours
Samples from the 'colour wheel' at equally spaced intervals, where red (#ff0000
/ rgb(255, 0, 0)
/ hsl(0, 1, 0.5)
) is the starting point.
For example: calling colourRange(3)
will give you 3 colours as wide apart as possible, in this case red, blue, and green [ 'ff0000', '00ff00', '0000ff' ]
This works for providing up to 360 unique colours
Kind: global function
Returns: Array.<string>
- - List of unique hex values
Param | Type | Default | Description |
---|---|---|---|
range | number | 1 | Number of unique colours to produce, maximum is 360 |
options | Object | ||
[options.saturation] | number | 1 | Saturation of colours |
[options.lightness] | number | 0.5 | Lightness of colours |
[options.prefix] | boolean | false | Prefix the colours with a '#' |
Example
import colourRange from 'colour-range'
colourRange(3)
// [ 'ff0000', '00ff00', '0000ff' ] (RGB)
colourRange(3, { prefix: true })
// [ '#ff0000', '#00ff00', '#0000ff' ]
colourRange(3, { saturation: 0.6, lightness: 0.2, prefix: true })
// [ '#521414', '#145214', '#141452' ]
colourRange(360)
// [ 'ff0000', ..., 'ff0004' ]
FAQs
Get a wide list of unique colours, based on shifting the hue of the colours
The npm package colour-range receives a total of 0 weekly downloads. As such, colour-range popularity was classified as not popular.
We found that colour-range 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.