bgrins / TinyColor

Fast, small color manipulation and conversion for JavaScript
https://bgrins.github.io/TinyColor/
MIT License
5.05k stars 438 forks source link

Feature request: isWarmColor, isCoolColor, isDarker, isLighter, isHarmonious #201

Open ex-tag opened 5 years ago

ex-tag commented 5 years ago

Warm colors have more red, and cool colors have more blue. Please add isWarmColor() and isCoolColor() methods.

To check RGB color, code might look like...

red = 0
blue = 0

if (red > blue) {
  isWarmColor = true
  isCoolColor = false
}
else if (red < blue) {
  isWarmColor = false
  isCoolColor = true
}
else {
  isWarmColor = false
  isCoolColor = false
}
ex-tag commented 5 years ago

isWarm - checks if color is Warm color isCool - checks if color is Cool color isWarmer - checks if one color is warmer than another color isCooler - checks if one color is cooler than another color isLighter - checks if a color is lighter than another color isDarker - checks if a color is darker than another color isHarmonious - checks if two colors are harmonious

hendrul commented 4 years ago

Isn't there any warmer/cooler manipulators?