JSPM

@chriscodesthings/random-css-hex-color

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 97
  • Score
    100M100P100Q75114F
  • License MIT

Generates a random color in CSS hex format

Package Exports

  • @chriscodesthings/random-css-hex-color
  • @chriscodesthings/random-css-hex-color/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@chriscodesthings/random-css-hex-color) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

random-css-hex-color · Test workflow status NPM Version License: MIT

Generates a random color in CSS hex format

Install

npm install --save @chriscodesthings/random-css-hex-color

Use

import randomHexColor from '@chriscodesthings/random-css-hex-color';

console.log(randomHexColor());
// => #c7a34b

Syntax

randomHexColor(dark);

Parameters

  • dark: If undefined, any color is returned. If true, color is dark based on YIQ calculation. If false, color is light based on YIQ calculation.

Return Value

Returns a CSS hex color code string.

Description

Does what it says on the tin.