function gr_line_with_up_padding(circle_angles, distance, size, from, to)
distance = distance - size * 2 - 3
local draw_list = imgui.GetWindowDrawList()
local p = imgui.GetCursorScreenPos()
draw_list:AddCircleFilled(imgui.ImVec2(p.x + size + (size / 100), p.y + size), size, from, circle_angles)
draw_list:AddRectFilled(imgui.ImVec2(p.x, p.y + size), imgui.ImVec2(p.x + size * 2, p.y + size * 2), from)
draw_list:AddCircleFilled(imgui.ImVec2(p.x + size + (size / 100) + distance, p.y + size), size, to, circle_angles)
draw_list:AddRectFilled(imgui.ImVec2(p.x + size + distance, p.y + size), imgui.ImVec2(p.x + size * 2 + distance, p.y + size * 2), to)
draw_list:AddRectFilled(imgui.ImVec2(p.x + size, p.y), imgui.ImVec2(p.x + distance + size, p.y + size * 2), from)
local a, r, g, b = explode_argb(to)
for i = 0, distance do
a = (i / distance) * 255
draw_list:AddRectFilled(imgui.ImVec2(p.x + i + size, p.y), imgui.ImVec2(p.x + 1 + i + size, p.y + size * 2), join_argb(a, r, g, b))
end
end
function gr_line_with_down_padding(circle_angles, distance, size, from, to)
distance = distance - size * 2 - 3
local draw_list = imgui.GetWindowDrawList()
local p = imgui.GetCursorScreenPos()
draw_list:AddCircleFilled(imgui.ImVec2(p.x + size + (size / 100), p.y + size), size, from, circle_angles)
draw_list:AddRectFilled(imgui.ImVec2(p.x, p.y + size), imgui.ImVec2(p.x + size * 2, p.y), from)
draw_list:AddCircleFilled(imgui.ImVec2(p.x + size + (size / 100) + distance, p.y + size), size, to, circle_angles)
draw_list:AddRectFilled(imgui.ImVec2(p.x + size + distance, p.y + size), imgui.ImVec2(p.x + size * 2 + distance, p.y), to)
draw_list:AddRectFilled(imgui.ImVec2(p.x + size, p.y), imgui.ImVec2(p.x + distance + size, p.y + size * 2), from)
local a, r, g, b = explode_argb(to)
for i = 0, distance do
a = (i / distance) * 255
draw_list:AddRectFilled(imgui.ImVec2(p.x + i + size, p.y), imgui.ImVec2(p.x + 1 + i + size, p.y + size * 2), join_argb(a, r, g, b))
end
end
function rainbow(speed, alpha, offset)
local clock = os.clock() + offset
local r = math.floor(math.sin(clock * speed) * 127 + 128)
local g = math.floor(math.sin(clock * speed + 2) * 127 + 128)
local b = math.floor(math.sin(clock * speed + 4) * 127 + 128)
return r, g, b, alpha
end
function join_argb(a, r, g, b) -- by FYP
local argb = b -- b
argb = bit.bor(argb, bit.lshift(g, 8)) -- g
argb = bit.bor(argb, bit.lshift(r, 16)) -- r
argb = bit.bor(argb, bit.lshift(a, 24)) -- a
return argb
end
function explode_argb(argb)
local a = bit.band(bit.rshift(argb, 24), 0xFF)
local r = bit.band(bit.rshift(argb, 16), 0xFF)
local g = bit.band(bit.rshift(argb, 8), 0xFF)
local b = bit.band(argb, 0xFF)
return a, r, g, b
end