Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,19 @@
def svg:
"<svg width='100%' height='100%' version='1.1'
xmlns='http://www.w3.org/2000/svg'
xmlns:xlink='http://www.w3.org/1999/xlink'>" ;
# A radial gradient to make a circle look like a sphere.
# "colors" should be [startColor, intermediateColor, endColor]
# or null for ["white", "teal", "black"]
def sphericalGradient(id; colors):
"<defs>
<radialGradient id = '\(id)' cx = '30%' cy = '30%' r = '100%' fx='10%' fy='10%' >
<stop stop-color = '\(colors[0]//"white")' offset = '0%'/>
<stop stop-color = '\(colors[1]//"teal")' offset = '50%'/>
<stop stop-color = '\(colors[1]//"black")' offset = '100%'/>
</radialGradient>
</defs>" ;
def sphere(cx; cy; r; gradientId):
"<circle fill='url(#\(gradientId))' cx='\(cx)' cy='\(cy)' r='\(r)' />" ;

View file

@ -0,0 +1,9 @@
def draw_sphere:
svg,
"<title>Teal sphere</title>",
sphericalGradient("tealGradient"; null), # define the gradient to use
sphere(100;100;100; "tealGradient"), # draw a sphere using the gradient
sphere(100;300;100; "tealGradient"), # draw another sphere using the same gradient
"</svg>" ;
draw_sphere

View file

@ -0,0 +1 @@
$ jq -r -n -f spheres.jq > spheres.svg