[Performance] Improve tint and shade performance
Improve the performance of the tint and shade functions.
It is a tiny performance improvement and lib size reduction, but it does not degrade in any shape or form the quality of the code, so I believe it is a welcome change.
The improvement is achieved by exiting the parseToRgb function in the first IF that checks for HEX Colors, this way not testing or matching the default color unnecessarily.
Codecov Report
Merging #626 (8b70bb2) into main (275e646) will not change coverage. The diff coverage is
100.00%.
@@ Coverage Diff @@
## main #626 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 89 89
Lines 860 860
Branches 323 323
=========================================
Hits 860 860
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 100.00% <100.00%> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/color/shade.js | 100.00% <100.00%> (ø) |
|
| src/color/tint.js | 100.00% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.