Better Hex Color Codes for Your Internet
JavaScript, 86 82 77 bytes

x=&gt;([s,a=0,b=a,c,d,e,f]=x,f?x:e?x+e:[s,a,d||a,c?b:a,d||b,v=c||b,d||v].join``)


just find out that remove recursive save 4 bytes...

idea from @Arnauld save 4 bytes, +1 more bytes