Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

iridescent

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iridescent

🎨 Color conversion, extraction & utility library

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

iridescent

NPM Dependency Status devDependency Status Maintenance Status Known Vulnerabilities Discord Gitter Maintainability

🎨 Color conversion, extraction & utility library

Installation

npm install iridescent

Usage

import Iridescent from 'iridescent'

Iridescent.isDark(10, 20, 13) // true
Iridescent.isLight('#EEE') // true
Iridescent.isWhite([255, 255, 255]) // true
Iridescent.isBlack({r: 1, g: 1, b: 1}) // false

Iridescent.luminance([255, 255, 255]) // 254.99999999999997
Iridescent.luminance([128, 128, 128]) // 128
Iridescent.luminance([185, 100, 80]) // 116.627
Iridescent.luminance([0, 0, 0]) // 0

Iridescent.brightness([255, 255, 255]) // 255
Iridescent.brightness([128, 128, 128]) // 128
Iridescent.brightness([185, 100, 80]) // 123.135
Iridescent.brightness([0, 0, 0]) // 0

Iridescent.rgbToHex([0, 0, 0]) // #000000
Iridescent.rgbToHex(16, 16, 16) // #101010
Iridescent.rgbToHex({r: 255, g:255, b: 255}) // #ffffff

Iridescent.hexToRgb('#FFF') // {r: 255, g: 255, b: 255}
Iridescent.hexToRgb('#0F0F0F') // {r: 15, g: 15, b: 15}
Iridescent.hexToRgb('FFFFFF') // {r: 255, g: 255, b: 255}

Iridescent.rgbToHsl([185, 100, 80]) // {h: 0.03174603174603175, s: 0.4285714285714286, l: 0.5196078431372548}

Keywords

FAQs

Package last updated on 20 Nov 2018

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