Quickly mix two colours

this is a very simple script which will create 1:1 blend of selected foreground and background colours.
the best way to use it is to assign a keyboard shortcut.
useful for building palettes, blending and antialiasing.

-- *** QUICK MIX 0.1 *** --- 
-- based on aquova's hue generator 
-- https://github.com/aquova/aseprite-scripts 
-- 
-- blends foreground and background colours 

local c1 = app.fgColor 
local c2 = app.bgColor 

local mix = {
	red = (c1.red - c2.red),
	green = (c1.green - c2.green),
	blue = (c1.blue - c2.blue),
}

local newRed = c1.red - math.floor(mix.red * 0.5) 
local newGreen = c1.green - math.floor(mix.green * 0.5) 
local newBlue = c1.blue - math.floor(mix.blue * 0.5) 

local c3 = Color{
	r = newRed, 
	g = newGreen, 
	b = newBlue, 
	a = 255 --newAlpha
}

app.fgColor = c3