Skip to main content
saved 1 byte
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 649

JavaScript (ES6), 274273 bytes

Thanks to @Shaggy for suggesting to switch from HTML+JS to JS and saving 1 byte2 bytes in the new version

Generates a SVG similar to this one from Parcly Taxel.

f=(s=`<svg viewBox="-22 -23 44 4${a=6}">`)=>a--?f(s+(p='<path fill=')+`#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z"4" transform="rotate(${a*60})"/>`):s+p+`none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

Try it online!Try it online!

Graphical output

f=(s=`<svg viewBox="-22 -23 44 4${a=6}">`)=>a--?f(s+(p='<path fill=')+`#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z"4" transform="rotate(${a*60})"/>`):s+p+`none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

document.write(f())

JavaScript (ES6), 274 bytes

Thanks to @Shaggy for suggesting to switch from HTML+JS to JS and saving 1 byte in the new version

Generates a SVG similar to this one from Parcly Taxel.

f=(s=`<svg viewBox="-22 -23 44 4${a=6}">`)=>a--?f(s+(p='<path fill=')+`#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z" transform="rotate(${a*60})"/>`):s+p+`none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

Try it online!

Graphical output

f=(s=`<svg viewBox="-22 -23 44 4${a=6}">`)=>a--?f(s+(p='<path fill=')+`#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z" transform="rotate(${a*60})"/>`):s+p+`none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

document.write(f())

JavaScript (ES6), 273 bytes

Thanks to @Shaggy for suggesting to switch from HTML+JS to JS and saving 2 bytes in the new version

Generates a SVG similar to this one from Parcly Taxel.

f=(s=`<svg viewBox="-22 -23 44 4${a=6}">`)=>a--?f(s+(p='<path fill=')+`#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4" transform="rotate(${a*60})"/>`):s+p+`none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

Try it online!

Graphical output

f=(s=`<svg viewBox="-22 -23 44 4${a=6}">`)=>a--?f(s+(p='<path fill=')+`#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4" transform="rotate(${a*60})"/>`):s+p+`none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

document.write(f())

saved 3 bytes
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 649

JavaScript (ES6), 277274 bytes

Thanks to @Shaggy for suggesting to switch from HTML+JS to JS and saving 1 byte in the new version

Generates a SVG similar to this one from Parcly Taxel.

f=(a=6,s='<svgs=`<svg viewBox="-22 -23 44 46">'4${a=6}">`)=>a--?f(a,s+`<paths+(p='<path fill=#5$fill=')+`#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z" transform="rotate(${a*60})"/>`):s+`<path fill=nones+p+`none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

Try it online!Try it online!

Graphical output

f=(a=6,s='<svgs=`<svg viewBox="-22 -23 44 46">'4${a=6}">`)=>a--?f(a,s+`<paths+(p='<path fill=#5$fill=')+`#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z" transform="rotate(${a*60})"/>`):s+`<path fill=nones+p+`none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

document.write(f())

JavaScript (ES6), 277 bytes

Thanks to @Shaggy for suggesting to switch from HTML+JS to JS

Generates a SVG similar to this one from Parcly Taxel.

f=(a=6,s='<svg viewBox="-22 -23 44 46">')=>a--?f(a,s+`<path fill=#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z" transform="rotate(${a*60})"/>`):s+`<path fill=none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

Try it online!

Graphical output

f=(a=6,s='<svg viewBox="-22 -23 44 46">')=>a--?f(a,s+`<path fill=#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z" transform="rotate(${a*60})"/>`):s+`<path fill=none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

document.write(f())

JavaScript (ES6), 274 bytes

Thanks to @Shaggy for suggesting to switch from HTML+JS to JS and saving 1 byte in the new version

Generates a SVG similar to this one from Parcly Taxel.

f=(s=`<svg viewBox="-22 -23 44 4${a=6}">`)=>a--?f(s+(p='<path fill=')+`#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z" transform="rotate(${a*60})"/>`):s+p+`none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

Try it online!

Graphical output

f=(s=`<svg viewBox="-22 -23 44 4${a=6}">`)=>a--?f(s+(p='<path fill=')+`#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z" transform="rotate(${a*60})"/>`):s+p+`none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

document.write(f())

saved 35 bytes
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 649

HTML+JSJavaScript (ES6), 312277 bytes

A slightly compressed version ofThanks to @Shaggy for suggesting to switch from HTML+JS to JS

Generates a SVG similar to this SVG fileone byfrom Parcly Taxel.

f=(a=6,s='<svg viewBox="-22 -23 44 46">')=>a--?f(a,s+`<path fill=#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z" transform="rotate(${a*60})"/>`):s+`<path fill=none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

Not exactly W3C compliant, but this should work on all major browsers.Try it online!

Graphical output

<html><script>for(s='<svg viewBox="-22 -23 44 46">',a=6;a--;)s+=`<path fill=#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z" transform="rotate(${a*60})"/>`;document.write(s+`<path fill=none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`)</script>
f=(a=6,s='<svg viewBox="-22 -23 44 46">')=>a--?f(a,s+`<path fill=#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z" transform="rotate(${a*60})"/>`):s+`<path fill=none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

document.write(f())

HTML+JS, 312 bytes

A slightly compressed version of this SVG file by Parcly Taxel.

Not exactly W3C compliant, but this should work on all major browsers.

<html><script>for(s='<svg viewBox="-22 -23 44 46">',a=6;a--;)s+=`<path fill=#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z" transform="rotate(${a*60})"/>`;document.write(s+`<path fill=none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`)</script>

JavaScript (ES6), 277 bytes

Thanks to @Shaggy for suggesting to switch from HTML+JS to JS

Generates a SVG similar to this one from Parcly Taxel.

f=(a=6,s='<svg viewBox="-22 -23 44 46">')=>a--?f(a,s+`<path fill=#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z" transform="rotate(${a*60})"/>`):s+`<path fill=none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

Try it online!

Graphical output

f=(a=6,s='<svg viewBox="-22 -23 44 46">')=>a--?f(a,s+`<path fill=#5${a&1?'a318e':'4a2e1'} d="M20.3-9C14.8 5 5.8 5.6.4 5.3L-.1 7.2C6.5 9 15.6 8.4 21.6-.4Z" transform="rotate(${a*60})"/>`):s+`<path fill=none stroke=#576ab7 d="M-10.2 4.5-9-6.6 1.2-11.1 10.2-4.5 9 6.6-1.2 11.1Z">`

document.write(f())

saved 4 bytes
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 649
Loading
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 649
Loading