A lightweight programming environment for desktop and mobile devices
draw_settings_menu = function()
	App.color(Menu_background)
	local w,h = 200, 130+2*Line_height
	local x,y = Safe_width-Side_button_width-w, Menu_bottom
	Settings_menu_area = {x=x, y=y, w=w, h=h}
	love.graphics.rectangle('fill', x,y, w,h)
	App.color(Normal_color)
	-- font size slider
	love.graphics.print('font size', x+10,y+10)
	y = y+10+Line_height
	local sx = x+Font:getWidth('bg')+50  -- align all sliders
	slider(Global_state, 'font', {
		fg=Normal_color,
		-- x limits
		x0=sx+20, x1=Safe_width-Side_button_width-10,
		-- central y
		y0=y+10,
		-- slider knob dimensions
		w=10, h=10,
		-- extremes
		lo=12, hi=40,  -- font sizes
		value=Current_pane.editor_state.font_height,
		update=update_font_settings,
	})
	y = y+10
	-- colors
	love.graphics.print('colors', x+10,y+10)
	y = y+10+Line_height
	-- colors/foreground
	love.graphics.print('fg', x+20, y)
	App.color(Foreground_color)
	love.graphics.rectangle('fill', sx-20,y+5, 20,20)
	local prev = Global_state.slider_handlers.font
	for _,color in ipairs{'r', 'g', 'b'} do
		slider(Global_state, 'fg/'..color, {
			fg=Normal_color,
			x0=prev.x0, x1=prev.x1,
			y0=y,
			w=prev.w, h=prev.h,
			lo=0, hi=1,
			value=Foreground_color[color],
			update=function(v) Foreground_color[color] = v end,
		})
		y = y+15
	end
	y = y+5
	-- colors/background
	love.graphics.print('bg', x+20, y)
	App.color(Background_color)
	love.graphics.rectangle('fill', sx-20,y+5, 20,20)
	for _,color in ipairs{'r', 'g', 'b'} do
		slider(Global_state, 'bg/'..color, {
			fg=Normal_color,
			x0=prev.x0, x1=prev.x1,
			y0=y,
			w=prev.w, h=prev.h,
			lo=0, hi=1,
			value=Background_color[color],
			update=function(v) Background_color[color] = v end,
		})
		y = y+15
	end
end