RadialGradient.radius read/write property


Get or set the horizontal and vertical radius of the gradient ellipse

To set this property, use a table as a list of two numbers, for example { 0, 0 }
When getting this property, you can access the coordinates by using the fields x and y

Example

local ui = require "ui" require "canvas" -- create a simple Window local win = ui.Window("RadialGradient.radius sample", "fixed", 500, 400) -- create a Canvas local canvas = ui.Canvas(win) canvas.align = "all" local gradient = canvas:RadialGradient { [0] = 0xE30940FF, [0.33] = 0xE7D702FF, [0.66] = 0x0FA895FF, [1] = 0x1373E8FF } gradient.center = { canvas.width/2, canvas.height/2 } gradient.radius = { canvas.width/2, canvas.height/2 } function canvas:onPaint() self:fillrect(0, 0, canvas.width, canvas.height, gradient) end function canvas:onHover(x, y) gradient.radius = { x, y } end win:show() -- update user interface repeat ui.update() until not win.visible