Color tweaks

main
mat ess 2022-09-14 23:37:16 -04:00
parent a3ad2913f1
commit 08a8089529
3 changed files with 8 additions and 8 deletions

View File

@ -42,9 +42,8 @@ local function initScreen()
WIDTH, HEIGHT = round2even(width), round2even(height) WIDTH, HEIGHT = round2even(width), round2even(height)
CANVAS = love.graphics.newCanvas(WIDTH, HEIGHT) CANVAS = love.graphics.newCanvas(WIDTH, HEIGHT)
CANVAS:renderTo(function() CANVAS:renderTo(function()
local color = COLORS[1].rgba local c = COLORS[1].rgba
color[4] = 0.9 love.graphics.setColor({ c[1], c[2], c[3], 0.9 })
love.graphics.setColor(color)
love.graphics.rectangle("fill", 0, 0, WIDTH, HEIGHT) love.graphics.rectangle("fill", 0, 0, WIDTH, HEIGHT)
end) end)
end end

View File

@ -17,12 +17,13 @@ local function initColors()
local scheme = colorbrewer.random(2) local scheme = colorbrewer.random(2)
ON = scheme[1] ON = scheme[1]
OFF = scheme[2] OFF = scheme[2]
OFF_BG = { OFF[1], OFF[2], OFF[3], 0.9 }
end end
local function initScreen() local function initScreen()
local width, height = love.graphics.getDimensions() local width, height = love.graphics.getDimensions()
WIDTH, HEIGHT = round2even(width), round2even(height) WIDTH, HEIGHT = round2even(width), round2even(height)
love.graphics.setBackgroundColor(OFF[1], OFF[2], OFF[3], 0.9) love.graphics.setBackgroundColor(OFF_BG)
end end
local function initFont() local function initFont()
@ -167,7 +168,7 @@ function love.draw()
if on then if on then
love.graphics.setColor(ON) love.graphics.setColor(ON)
else else
love.graphics.setColor(OFF) love.graphics.setColor(OFF_BG)
end end
love.graphics.rectangle("fill", x, y, UNITS, UNITS) love.graphics.rectangle("fill", x, y, UNITS, UNITS)
end end

View File

@ -3,15 +3,15 @@ require "util"
local function initColors() local function initColors()
local colorbrewer = require("colorbrewer") local colorbrewer = require("colorbrewer")
COLORS = colorbrewer.random(4) COLORS = colorbrewer.random(4)
local c = COLORS[#COLORS]
BG = { c[1], c[2], c[3], 0.9 }
BLACK = { 0, 0, 0, 1 } BLACK = { 0, 0, 0, 1 }
end end
local function initScreen() local function initScreen()
local width, height = love.graphics.getDimensions() local width, height = love.graphics.getDimensions()
WIDTH, HEIGHT = round2even(width), round2even(height) WIDTH, HEIGHT = round2even(width), round2even(height)
local color = COLORS[#COLORS] love.graphics.setBackgroundColor(BG)
color[4] = 0.9
love.graphics.setBackgroundColor(color)
end end
local function initFont() local function initFont()