Socket
Socket
Sign inDemoInstall

@kurkle/color

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kurkle/color

css color parsing, manupulation and conversion


Version published
Weekly downloads
1.8M
decreased by-1.83%
Maintainers
1
Weekly downloads
 
Created

What is @kurkle/color?

The @kurkle/color npm package is designed for color manipulation and conversion. It provides a set of tools for parsing colors, converting them between different formats (e.g., HEX, RGB, HSL), and manipulating their properties (e.g., brightness, alpha). This package can be particularly useful in web development, data visualization, and any application where color manipulation is required.

What are @kurkle/color's main functionalities?

Parsing and converting colors

This feature allows the parsing of color strings in various formats and their conversion into other formats. The example demonstrates converting an RGB color to its hexadecimal representation.

"const {color} = require('@kurkle/color');\nconst col = color('rgb(255, 99, 132)');\nconsole.log(col.hexString()); // Outputs: '#FF6384'"

Manipulating color properties

This feature enables the manipulation of color properties such as lightness. The example shows how to make a color lighter by a certain percentage.

"const {color} = require('@kurkle/color');\nconst col = color('hsl(100, 50%, 50%)').lighten(0.2);\nconsole.log(col.hslString()); // Outputs a lighter HSL color string"

Alpha transparency manipulation

This feature allows for the manipulation of the alpha transparency of a color. The example demonstrates changing the alpha value of an RGBA color.

"const {color} = require('@kurkle/color');\nconst col = color('rgba(255, 99, 132, 0.5)').alpha(0.75);\nconsole.log(col.rgbaString()); // Outputs an RGBA color string with updated alpha"

Other packages similar to @kurkle/color

Keywords

FAQs

Package last updated on 10 Jan 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc