-- background stuff


local function defaultHide(child)
	child.TextTransparency = 2;
	child.BackgroundTransparency = 2;
	child.TextStrokeTransparency = 2;
end;

local function newBackground(child, class)
	local frame = instance("Frame", child);
	frame.Name = "_background";
	frame.Size = udim2(1, 0, 1, 0);
	frame.BackgroundTransparency = child.BackgroundTransparency;
	frame.BackgroundColor3 = child.BackgroundColor3;
	frame.BorderSizePixel = child.BorderSizePixel;
	frame.BorderColor3 = child.BorderColor3;
	frame.ZIndex = child.ZIndex;
	if (class == "TextButton") then
		frame.MouseEnter:connect(function()
			if child.AutoButtonColor then 
				local origin = child.BackgroundColor3;
				frame.BackgroundColor3 = color3(origin.r - 75/255, origin.g - 75/255, origin.b - 75/255); 
			end;
		end);
		child.MouseLeave:connect(function()
			if child.AutoButtonColor then
				frame.BackgroundColor3 = child.BackgroundColor3;
			end;
		end);
	end;
	return frame;
end;
