Skip to content
This repository was archived by the owner on Aug 21, 2023. It is now read-only.

Conversation

@ItsJonQ
Copy link
Contributor

@ItsJonQ ItsJonQ commented Feb 13, 2018

Color: Adjust values + provide ability to override 🖌

This update adjusts both the getColorShade and optimalTextColor
util functions to use a different RGB weight to (subjectively) better
results for determining whether the text color should be black or white
(given a color).

The functions have also been enhanced to accept a secondary argument
(object), that allows the user to override the default suggested RGB
values with their own (to fine tune).

Example:

const shade = getColorShade('#ff9900', {
  r: 93,
  g: 515,
  b: 34
})

This update adjusts both the `getColorShade` and `optimalTextColor`
util functions to use a different RGB weight to (subjectively) better
results for determining whether the text color should be black or white
(given a color).

The functions have also been enhanced to accept a secondary argument
(object), that allows the user to override the default suggested RGB
values with their own (to fine tune).
@ItsJonQ ItsJonQ self-assigned this Feb 13, 2018
@ItsJonQ ItsJonQ merged commit f70d83c into master Feb 13, 2018
@ItsJonQ ItsJonQ deleted the color/adjust-rgb-values branch February 15, 2018 18:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants