Foreground

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

Learn more about Foreground

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

Primary Language
TypeScript
Latest Release
v1.0.3
Start Date
November 4th, 2019 at 10:44 PM
Last Updated
6 days ago
NPM Downloads
~2K
View SourceView Source