Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.
/ foreground Public archive

🖋️ Determine whether a given background color will need a light or dark foreground

License

Notifications You must be signed in to change notification settings

pqt-graveyard/foreground

Repository files navigation

foreground

Determine whether a given background color will need a light or dark foreground

Current npm package version. Released under the MIT license. Current Github Action build status. Downloads per month on npm. Total downloads on npm. Follow @pqtdev

Installation

npm install @pqt/foreground
# OR
yarn add @pqt/foreground

Usage

import { foreground } from "@pqt/foreground";

foreground("fff"); // => returns "dark"
foreground("000"); // => returns "light"
foreground("005cc5"); // => returns "light"

License

MIT