--Change the color of the brush when the text box is used

brushSettings.ColorBox.FocusLost:Connect(function(entered)
	
	if entered then
		
		local color = brushSettings.ColorBox.Text
		color = string.gsub(color, " ", "")
		color = string.split(color, ",")
		
		if tonumber(color[1]) and tonumber(color[2]) and tonumber(color[3]) then
			
			currentColor = Color3.fromRGB(color[1], color[2], color[3])
		end
		
		brushSettings.ColorBox.Text = math.floor(currentColor.R * 255 + 0.5) .. ", " .. math.floor(currentColor.G * 255 + 0.5) .. ", " .. math.floor(currentColor.B * 255 + 0.5)

		brushSettings.PaintImage.ImageColor3 = currentColor
	end
end)

