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

relative-luminance

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

relative-luminance

calculate relative luminance

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
54K
decreased by-1.72%
Maintainers
1
Weekly downloads
 
Created
Source

Greenkeeper badge CircleCI

relative-luminance

npm install relative-luminance

Calculate the relative luminance of an RGB triplet color.

Note that as of 1.0.0, this module doesn't directly export a function if you're using CommonJS: use the default export, like:

var luminance = require('relative-luminance').default;

API

Table of Contents
relativeLuminance

Given a 3-element array of R, G, B varying from 0 to 255, return the luminance as a number from 0 to 1.

Parameters
Examples
var luminance = require('relative-luminance');
var black_lum = luminance([0, 0, 0]); // 0

Returns number luminance, between 0 and 1

Keywords

FAQs

Package last updated on 30 Dec 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