Skip to content

0zBug/svg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

documentation coming soon™️

local svg = require("svg")
local Drawing = svg.new()

local Definitions = Drawing.new("defs")

local Gradient = Definitions.new("linearGradient")
Gradient.id = "Gradient1"

local Stop = Gradient.new("stop")
Stop.stop_color = "white"
Stop.offset = "5%"

local Stop = Gradient.new("stop")
Stop.stop_color = "blue"
Stop.offset = "95%"

local Gradient = Definitions.new("linearGradient")
Gradient.id = "Gradient2"

local Stop = Gradient.new("stop")
Stop.stop_color = "red"
Stop.offset = "5%"

local Stop = Gradient.new("stop")
Stop.stop_color = "orange"
Stop.offset = "95%"

local Pattern = Definitions.new("pattern")
Pattern.id = "Pattern"
Pattern.x = 0
Pattern.y = 0
Pattern.width = 0.25
Pattern.height = 0.25

local Rect = Pattern.new("rect")
Rect.x = 0
Rect.y = 0
Rect.width = 25
Rect.height = 25
Rect.fill = "url(#Gradient2)"

local Circle = Pattern.new("circle")
Circle.cx = 25
Circle.cy = 25
Circle.r = 20
Circle.fill = "url(#Gradient1)"
Circle.fill_opacity = 0.5

local Rect = Drawing.new("rect")
Rect.width = 200
Rect.height = 200
Rect.fill = "url(#Pattern)"

writefile("pattern.svg", Drawing)

result

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages