daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. r=readline
  2. p=parseInt
  3. t=~~r()
  4. for(i=0;i<t;i++){
  5. c=r()
  6. writeline(c.replace(/#([A-Fa-f0-9]{3,6})/g,c=>{
  7. if(c.length<5)c='#'+[c[1],c[1],c[2],c[2],c[3],c[3]].join``
  8. b=p(c.substring(1),16)
  9. y=255
  10. return'rgb('+[(b>>16)&y,(b>>8)&y,b&y].join(',')+')'}))}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top