local l={}function l.fromUDim(l)local s=Instance.new("\085\073\080\097\100\100\105\110\103")s.PaddingBottom=l s.PaddingTop=l s.PaddingLeft=l s.PaddingRight=l return s end function l.getTotalPadding(l)return UDim2.new(l.PaddingLeft+l.PaddingRight,l.PaddingBottom+l.PaddingTop)end function l.getTotalAbsolutePadding(s,b)local p=l.getTotalPadding(s)return Vector2.new(p.X.Offset+p.X.Scale*b.x,p.Y.Offset+p.Y.Scale*b.Y)end function l.getHorizontalPadding(l)return l.PaddingLeft+l.PaddingRight end return l


local UIPaddingUtils = {}

function UIPaddingUtils.fromUDim(udim)
	local uiPadding = Instance.new("UIPadding")
	uiPadding.PaddingBottom = udim
	uiPadding.PaddingTop = udim
	uiPadding.PaddingLeft = udim
	uiPadding.PaddingRight = udim

	return uiPadding
end

function UIPaddingUtils.getTotalPadding(uiPadding)
	return UDim2.new(uiPadding.PaddingLeft + uiPadding.PaddingRight,
		uiPadding.PaddingBottom + uiPadding.PaddingTop)
end

function UIPaddingUtils.getTotalAbsolutePadding(uiPadding, absoluteSize)
	local padding = UIPaddingUtils.getTotalPadding(uiPadding)
	return Vector2.new(
		padding.X.Offset + padding.X.Scale*absoluteSize.x,
		padding.Y.Offset + padding.Y.Scale*absoluteSize.Y
	)
end

function UIPaddingUtils.getHorizontalPadding(uiPadding)
	return uiPadding.PaddingLeft + uiPadding.PaddingRight
end


return UIPaddingUtils
