New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@jeact/contrast-color

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jeact/contrast-color

Simple function to get the contrast color for a text over some color

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

@jeact/contrast-color

Jeact Logo

NPM Travis (.com) Libraries.io dependency status for latest release npm npm bundle size npm GitHub Repo stars

Simple function to get the contrast color for a text over some color.

Instalation

npm i @jeact/contrast-color

How to use

Import the function from the module and then use it providing a valid color, the function will return either "#ffffff" for dark colors and "#000000" for bright colors, this represents a good color for the text that makes a good contrast.

import contrastColor from '@jeact/contrast-color'

const backgroundColor = "#dd0000"
const textColor = contrastColor(backgroundColor)

Keywords

jeact

FAQs

Package last updated on 21 Nov 2021

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