Skip to content

Solid & Alpha Shades

Latest
Compare
Choose a tag to compare
@ugudango ugudango released this 13 Feb 22:59
· 2 commits to master since this release

NPM LINK

  • Added alpha shades. Now, instead of only being able to generate 100% opacity shades, transparent black/white shades can also be generated via generateAlpha from within ConsistentShading instances.

  • Added rgba as a result type for generateAlpha. It is a tuple of 4 numbers, and is not meant to work with convert.

  • Fixed some precision bugs. Shades should be more accurate now.

  • Fixed a bug which caused crashes (#1). If the input type was lch the converter would try to convert a type to itself, which is not defined in color-convert.

Description:

This release covers previous issues with 1.0.x such as #1. The precision of generation was also improved.

Beyond this, the biggest feature this mini-library needed was alpha shadows. Up until this version, it only generated solid colours. They are great, and most of the time more pleasant to look at, but in a CSS scenario, not many people would use 100% opacity box shadows.

#2 was confirmed to be an invalid issue, since the shades correspond to the luminance, so the hue might differ from the original, but the intensity of the shade will not.