Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 16, 2024 via pnpm

color 4.2.3

Color conversion and manipulation with CSS string support
Package summary
Share
0
issues
1
license
6
MIT
Package created
23 Jun 2011
Version published
5 Apr 2022
Maintainers
1
Total deps
6
Direct deps
2
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
6 Packages, Including:
color-convert@2.0.1
color-name@1.1.4
color-string@1.9.1
color@4.2.3
is-arrayish@0.3.2
simple-swizzle@0.2.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of color 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
color-convert2.0.18.79 kBMIT
prod
color-string1.9.13.3 kBMIT
prod

Visualizations

Frequently Asked Questions

What does color do?

The npm package named "color" is a JavaScript library that allows for immutable color conversion and manipulation with support for CSS color strings. This powerful library enables web developers to conveniently switch between various color models such as RGB, HSL, CMKY, and many more. In addition, it provides color manipulation features like lightening, darkening, or modifying saturation and hue.

How do you use color?

Installation and usage of the color package are straightforward. It can be installed with the npm command npm install color. Once installed, it needs to be required at the top of your JavaScript file with const Color = require('color').

There are multiple ways to create a new color instance:

const color = Color('rgb(255, 255, 255)') // using a string
const color = Color({r: 255, g: 255, b: 255}) // using an object
const color = Color.rgb(255, 255, 255) // using a method
const color = Color.rgb([255, 255, 255]) // using an array

You can then use various methods to manipulate and convert the color:

color.alpha(0.5).lighten(0.5); // Changes the alpha value and lightens the color
console.log(color.hsl().string());  // Returns color as hsla string

For more complex operations, many methods can be chained together:

color.green(100).grayscale().lighten(0.6);

Where are the color docs?

The color library's comprehensive documentation can be found in the README on the GitHub page (https://github.com/Qix-/color.git). It provides extensive examples and explanations showing how you can leverage the color package to handle color conversions and manipulations in your JavaScript projects. The documentation also includes references to the constructors, getters, CSS Strings, luminosity, and manipulation methods available.