Highlights
Block or Report
Block or report hz2
Report abuse
Contact GitHub support about this user’s behavior. Learn more about reporting abuse.
Report abusePinned
-
1-line-code-convert-color
1-line-code-convert-color 1// Convert hex color to RGBA color
2// x => current item
3// i => index
4// o => origin value
5const hex2rgba = h => h.replace('#','').split('').map((x,i,o)=>o.length< 6 ? [x,x]: x).flat().reduce((str,x,i,orig)=>i%2 ? str.replace("x", parseInt( orig[i-1]+ x , 16) ) + ([',',','].concat(orig.length < 7 ? [',1)']:[',',')']))[(i-1)/2] : str + 'x','rgba(')
-
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.