All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
5.4.0 - 2022-03-29
- Fixing type distribution issue
5.3.0 - 2022-03-03
- Fixing build distribution issue during install
5.2.0 - 2021-09-16
- Fixing install command package calling
husky install
5.1.0 - 2021-08-08
- Fixing issue when passing a key to be removed from cache that doesn't exist. Before the fix, if the consumer was passing a non-existent key, all the cached values were removed. Now, if a non-existent key is passed through the cache won't be changed
- Adding JSDocs for
clearCache
method - Adding
.lintstagedrc
configuration file - Applying changes to decrese bundle size to 2.2KB 🎉
5.0.0 - 2021-08-07
- Updating NodeJS version to v14.15.5
- Upgrading dependencies and devDependencies
- Adding
clearCache
function to removed values from memory cache. It also gives the option of clear all cached values from memory.
// Creating CSS filters for `#24639C` and `#FF0000`
// They memory cache stored is based on the received hex value
const [firstResult, secondResult, thirdResult, forthResult] = [
hexToCSSFilter('#24639C', { forceFilterRecalculation: false } as HexToCssConfiguration),
hexToCSSFilter('#24639C', { forceFilterRecalculation: false } as HexToCssConfiguration),
hexToCSSFilter('#FF0000', { forceFilterRecalculation: false } as HexToCssConfiguration),
hexToCSSFilter('#FF0000', { forceFilterRecalculation: false } as HexToCssConfiguration),
];
// ...
// ✨ Here is the place where the magic happens in your App ✨
// ...
// Removing the memory cache only for `#24639C`
// It means that `#FF0000` is still cached.
// It's quite handy in scenarios of colors that are called for several times,
// Having other ones called twice or thrice
clearCache('#24639C');
// Or you can just remove all cached values from memory
// by calling the function with no arguments
clearCache();
// `fifthResult` and `sixthResult` will/won't be computed again based on `clearCache` usage
const [fifthResult, sixthResult] = [
hexToCSSFilter('#24639C', { forceFilterRecalculation: false } as HexToCssConfiguration),
hexToCSSFilter('#FF0000', { forceFilterRecalculation: false } as HexToCssConfiguration),
];
4.0.0 - 2021-05-09
- Updating the project dependencies and devDependencies to the latest version
- Decreasing package bundle size
3.1.2 - 2020-07-24
- Fixing UMD bundle by using Rollup. Typescript was required in the package and one of the TS functions is required in the bundle.
3.1.1 - 2020-06-29
- Updating package dependencies and devDependencies to the latest
3.1.0 - 2020-06-29
- Adding boolean
cache
field into thehexToCSSFilter()
payload; - Adding
ynew configuration option:
forceFilterRecalculation
. It's a boolean value that forces recalculation for CSS filter generation. Default:false
;
- Fixing color generation using
maxTriesInLoop
to get the optimal color for the CSS filter
3.0.1 - 2020-06-28
- Increasing
maxChecks
from 15 to 30 - Adding private methods in classes
- Improving internal types
- Removing
any
from codebase
3.0.0 - 2020-06-25
- CSS Filter working properly when receives
#FFF
color; - Fixed internal issue on
hexToRgb
method when receiving#FFF
and#000
colors
- Breaking change:
HexToCssConfiguration
type now is usingacceptanceLossPercentage
instead ofacceptableLossPercentage
- acceptableLossPercentage?: number;
+ acceptanceLossPercentage?: number;
- Better types for internal methods
- Improving package documentation
- Adding documentation for consumers to use
#000
as a container background onREADME.md
2.0.4 - 2020-04-24
Solver
: Changing default target color to be white or black, based on the given color. It solves the issue when a color is darker and the returned CSS filter resolutions is incorrect.
E.G. https://codepen.io/willmendesneto/pen/pOVGVe
2.0.3 - 2020-04-24
- Fixing bundle size
- Setting the filter to white to take effect properly. Closes #7
Since Solver
is forcing the stored instance of color
to be white in rgb, the brightness should be white as well. That
means the filter is based on white, so it needs to set the filter to white to take effect.
hex-to-css-filter/src/solver.ts
Line 136 in 996d0c7
E.G.
- filter: invert(39%) sepia(91%) saturate(4225%) hue-rotate(162deg) brightness(95%) contrast(101%);
+ filter: brightness(0) invert(1) invert(39%) sepia(91%) saturate(4225%) hue-rotate(162deg) brightness(95%) contrast(101%);
2.0.2 - 2020-04-09
- Updating description
- Removing broken link
2.0.1 - 2020-04-09
- Bumped dependencies
- Upgraded NodeJS to 12.14.1
- Updated README.md with proper docs
- Fixed CircleCI pipeline
- Fixed Uglify issue on build task
- Fixed bundlesize task
- Fixed ESLint issue after upgrade
2.0.0 - 2020-01-09
- Migrating package to Typescript
BREAKING CHANGE:
To improve readability, these type definitions were renamed
Option
was renamed toHexToCssConfiguration
;ReturnValue
was renamed toHexToCssResult
;
1.0.3 - 2019-12-18
- Adding typescript types for package
1.0.2 - 2018-09-14
- Returning RGB as an array with red, green and blue values
1.0.1 - 2018-09-13
- First version of the package
- Adding memory cache to store the computed result
- Minor code changes to decrese bundle size to 2.2KB 🎉
- Using
Object.assign()
to return the best match object - Changing the color to check: from white to black
- Fixing editorconfig code style