Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b16aeea

Browse files
committed
add lighten-darken color code attribution
1 parent 1566b6b commit b16aeea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/utils/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Code inspired by Chris Coyier's vanilla css lighten/darken color solution
3+
* https://css-tricks.com/snippets/javascript/lighten-darken-color/
4+
*/
5+
16
const hexToRGB = (color) => {
27
const num = parseInt(color.replace('#', ''), 16)
38
const r = (num >> 16) - 30 // eslint-disable-line

0 commit comments

Comments
 (0)