Mystro256 3963d5c
From 0ae7ba046f14cef9857fd6c05d9072455097441f Mon Sep 17 00:00:00 2001
Mystro256 3963d5c
From: Mystro256 <alexjnewt at hotmail dot com>
Mystro256 3963d5c
Date: Tue, 12 Jun 2018 10:06:50 -0400
Mystro256 3963d5c
Subject: [PATCH] Love 11 support
Mystro256 3963d5c
Mystro256 3963d5c
---
Mystro256 3963d5c
 Canvas.lua            |  8 ++++----
Mystro256 3963d5c
 ColorMixer.lua        | 22 +++++++++++-----------
Mystro256 3963d5c
 CreditsController.lua |  4 ++--
Mystro256 3963d5c
 GalleryController.lua |  4 ++--
Mystro256 3963d5c
 GameController.lua    |  2 +-
Mystro256 3963d5c
 ImageTools.lua        |  6 +++---
Mystro256 3963d5c
 Palette.lua           | 16 ++++++++--------
Mystro256 3963d5c
 Preferences.lua       |  2 +-
Mystro256 3963d5c
 Sound.lua             |  2 +-
Mystro256 3963d5c
 TitleController.lua   |  6 +++---
Mystro256 3963d5c
 conf.lua              |  2 +-
Mystro256 3963d5c
 main.lua              |  2 +-
Mystro256 3963d5c
 mymath.lua            | 15 ++++++---------
Mystro256 3963d5c
 13 files changed, 44 insertions(+), 47 deletions(-)
Mystro256 3963d5c
Mystro256 3963d5c
diff --git a/Canvas.lua b/Canvas.lua
Mystro256 3963d5c
index f7db8ec..38fd430 100644
Mystro256 3963d5c
--- a/Canvas.lua
Mystro256 3963d5c
+++ b/Canvas.lua
Mystro256 3963d5c
@@ -11,7 +11,7 @@ function Canvas:initialize()
Mystro256 3963d5c
 
Mystro256 3963d5c
 	self.tool = 2
Mystro256 3963d5c
 	self.brush_dir = 1
Mystro256 3963d5c
-	self.color = { 224, 24, 24, 255 }
Mystro256 3963d5c
+	self.color = { 0.878, 0.094, 0.094, 1 }
Mystro256 3963d5c
 	self.width = 120
Mystro256 3963d5c
 	self.height =  160
Mystro256 3963d5c
 
Mystro256 3963d5c
@@ -39,7 +39,7 @@ function Canvas:reset()
Mystro256 3963d5c
 
Mystro256 3963d5c
 	local c = love.graphics.getCanvas()
Mystro256 3963d5c
 	love.graphics.setCanvas(self.canvas)
Mystro256 3963d5c
-	love.graphics.clear(241, 232, 199, 255)
Mystro256 3963d5c
+	love.graphics.clear(0.945, 0.910, 0.780, 1)
Mystro256 3963d5c
 	love.graphics.setCanvas(c)
Mystro256 3963d5c
 end
Mystro256 3963d5c
 
Mystro256 3963d5c
@@ -117,7 +117,7 @@ function Canvas:update(dt)
Mystro256 3963d5c
 			self.brush_dir = 1
Mystro256 3963d5c
 		end
Mystro256 3963d5c
 
Mystro256 3963d5c
-		love.graphics.setColor(255, 255, 255, 255)
Mystro256 3963d5c
+		love.graphics.setColor(1, 1, 1, 1)
Mystro256 3963d5c
 		love.graphics.setCanvas(oldCanvas)
Mystro256 3963d5c
 	end
Mystro256 3963d5c
 
Mystro256 3963d5c
@@ -164,7 +164,7 @@ function Canvas:gui()
Mystro256 3963d5c
 		end
Mystro256 3963d5c
 	end
Mystro256 3963d5c
 
Mystro256 3963d5c
-	love.graphics.setColor(255, 255, 255)
Mystro256 3963d5c
+	love.graphics.setColor(1, 1, 1)
Mystro256 3963d5c
 end
Mystro256 3963d5c
 
Mystro256 3963d5c
 function Canvas:swap()
Mystro256 3963d5c
diff --git a/ColorMixer.lua b/ColorMixer.lua
Mystro256 3963d5c
index fca17a9..79bbd31 100644
Mystro256 3963d5c
--- a/ColorMixer.lua
Mystro256 3963d5c
+++ b/ColorMixer.lua
Mystro256 3963d5c
@@ -1,10 +1,10 @@
Mystro256 3963d5c
 local ColorMixer = class("ColorMixer", Entity)
Mystro256 3963d5c
 
Mystro256 3963d5c
 ColorMixer.static.COLORS = {
Mystro256 3963d5c
-	{ 255, 255, 255 }, { 0, 0, 0 },
Mystro256 3963d5c
-	{ 192,0,0 }, { 255,160,0 },
Mystro256 3963d5c
-	{ 255,255,0 }, { 0,128,0 },
Mystro256 3963d5c
-	{ 0,0,192 }, { 128,0,128 }
Mystro256 3963d5c
+	{ 1, 1, 1 }, { 0, 0, 0 },
Mystro256 3963d5c
+	{ 0.75,0,0 }, { 1,0.625,0 },
Mystro256 3963d5c
+	{ 1,1,0 }, { 0,0.5,0 },
Mystro256 3963d5c
+	{ 0,0,0.75 }, { 0.5,0,0.5 }
Mystro256 3963d5c
 }
Mystro256 3963d5c
 
Mystro256 3963d5c
 function ColorMixer:initialize(slot, color)
Mystro256 3963d5c
@@ -13,7 +13,7 @@ function ColorMixer:initialize(slot, color)
Mystro256 3963d5c
 	self.slot = slot
Mystro256 3963d5c
 	self:reset()
Mystro256 3963d5c
 
Mystro256 3963d5c
-	local h, s, v = math.rgbtohsv(color[1], color[2], color[3], 255)
Mystro256 3963d5c
+	local h, s, v = math.rgbtohsv(color[1], color[2], color[3], 1)
Mystro256 3963d5c
 	local hasHue = false
Mystro256 3963d5c
 	if s > 0 then hasHue = true end
Mystro256 3963d5c
 	self:updateColor(color, hasHue)
Mystro256 3963d5c
@@ -47,8 +47,8 @@ function ColorMixer:updateColor(color, hasHue)
Mystro256 3963d5c
 		return
Mystro256 3963d5c
 	end
Mystro256 3963d5c
 
Mystro256 3963d5c
-	local oh, os, ov = math.rgbtohsv(self.mycolor[1], self.mycolor[2], self.mycolor[3], 255)
Mystro256 3963d5c
-	local nh, ns, nv = math.rgbtohsv(color[1], color[2], color[3], 255)
Mystro256 3963d5c
+	local oh, os, ov = math.rgbtohsv(self.mycolor[1], self.mycolor[2], self.mycolor[3], 1)
Mystro256 3963d5c
+	local nh, ns, nv = math.rgbtohsv(color[1], color[2], color[3], 1)
Mystro256 3963d5c
 
Mystro256 3963d5c
 	local h, s, v
Mystro256 3963d5c
 	if self.hasHue and hasHue then
Mystro256 3963d5c
@@ -63,7 +63,7 @@ function ColorMixer:updateColor(color, hasHue)
Mystro256 3963d5c
 	s = (2*os + ns) / 3
Mystro256 3963d5c
 	v = (2*ov + nv) / 3
Mystro256 3963d5c
 
Mystro256 3963d5c
-	local r, g, b = math.hsvtorgb(h, s, v, 255)
Mystro256 3963d5c
+	local r, g, b = math.hsvtorgb(h, s, v, 1)
Mystro256 3963d5c
 	self.mycolor = { r, g, b }
Mystro256 3963d5c
 	self.hasHue = self.hasHue or hasHue
Mystro256 3963d5c
 end
Mystro256 3963d5c
@@ -123,13 +123,13 @@ end
Mystro256 3963d5c
 function ColorMixer:gui()
Mystro256 3963d5c
 	local mx, my = Mouse.static:getPosition()
Mystro256 3963d5c
 
Mystro256 3963d5c
-	love.graphics.setColor(0, 0, 0, 200)
Mystro256 3963d5c
+	love.graphics.setColor(0, 0, 0, 0.784)
Mystro256 3963d5c
 	love.graphics.rectangle("fill", 0, 0, 180, HEIGHT)
Mystro256 3963d5c
 	love.graphics.rectangle("fill", 300, 0, 180, HEIGHT)
Mystro256 3963d5c
 	love.graphics.rectangle("fill", 180, 0, 120, 10)
Mystro256 3963d5c
 	love.graphics.rectangle("fill", 180, 170, 120, HEIGHT-170)
Mystro256 3963d5c
 
Mystro256 3963d5c
-	love.graphics.setColor(255, 255, 255, 255)
Mystro256 3963d5c
+	love.graphics.setColor(1, 1, 1, 1)
Mystro256 3963d5c
 	for i=1, #ColorMixer.static.COLORS do
Mystro256 3963d5c
 		local x = (i % 4) * 40
Mystro256 3963d5c
 		local y = math.floor((i-1) / 4) * 64
Mystro256 3963d5c
@@ -155,7 +155,7 @@ function ColorMixer:gui()
Mystro256 3963d5c
 		end
Mystro256 3963d5c
 	end
Mystro256 3963d5c
 
Mystro256 3963d5c
-	love.graphics.setColor(255, 255, 255, 255)
Mystro256 3963d5c
+	love.graphics.setColor(1, 1, 1, 1)
Mystro256 3963d5c
 
Mystro256 3963d5c
 	love.graphics.draw(self.reset_button, 115, 215, 0, 1, 1, 16, 16)
Mystro256 3963d5c
 	love.graphics.draw(self.submit_button, 201, 202)
Mystro256 3963d5c
diff --git a/CreditsController.lua b/CreditsController.lua
Mystro256 3963d5c
index b5152ad..25ce41f 100644
Mystro256 3963d5c
--- a/CreditsController.lua
Mystro256 3963d5c
+++ b/CreditsController.lua
Mystro256 3963d5c
@@ -71,9 +71,9 @@ function CreditsController:gui()
Mystro256 3963d5c
 	local mx, my = Mouse.static:getPosition()
Mystro256 3963d5c
 	local offset = math.cos(self.time*10)*2
Mystro256 3963d5c
 
Mystro256 3963d5c
-	love.graphics.setColor(53, 30, 24)
Mystro256 3963d5c
+	love.graphics.setColor(0.208, 0.118, 0.094)
Mystro256 3963d5c
 	love.graphics.rectangle("fill", 0, 0, WIDTH, HEIGHT)
Mystro256 3963d5c
-	love.graphics.setColor(255, 255, 255, 255)
Mystro256 3963d5c
+	love.graphics.setColor(1, 1, 1, 1)
Mystro256 3963d5c
 
Mystro256 3963d5c
 	love.graphics.push()
Mystro256 3963d5c
 	love.graphics.translate(0, -self.scroll)
Mystro256 3963d5c
diff --git a/GalleryController.lua b/GalleryController.lua
Mystro256 3963d5c
index 0941dcb..35dd180 100644
Mystro256 3963d5c
--- a/GalleryController.lua
Mystro256 3963d5c
+++ b/GalleryController.lua
Mystro256 3963d5c
@@ -111,9 +111,9 @@ function GalleryController:gui()
Mystro256 3963d5c
 
Mystro256 3963d5c
 	local offset = math.cos(self.time*10)*2
Mystro256 3963d5c
 
Mystro256 3963d5c
-	love.graphics.setColor(53, 30, 24)
Mystro256 3963d5c
+	love.graphics.setColor(0.208, 0.118, 0.094)
Mystro256 3963d5c
 	love.graphics.rectangle("fill", 0, 0, WIDTH, HEIGHT)
Mystro256 3963d5c
-	love.graphics.setColor(255, 255, 255, 255)
Mystro256 3963d5c
+	love.graphics.setColor(1, 1, 1, 1)
Mystro256 3963d5c
 
Mystro256 3963d5c
 	love.graphics.push()
Mystro256 3963d5c
 	love.graphics.translate(0, -self.scroll)
Mystro256 3963d5c
diff --git a/GameController.lua b/GameController.lua
Mystro256 3963d5c
index 5063d5a..a4ebd34 100644
Mystro256 3963d5c
--- a/GameController.lua
Mystro256 3963d5c
+++ b/GameController.lua
Mystro256 3963d5c
@@ -135,7 +135,7 @@ function GameController:getCustomerImage()
Mystro256 3963d5c
 	local canvas = love.graphics.newCanvas(120, 160)
Mystro256 3963d5c
 	local c = love.graphics.getCanvas()
Mystro256 3963d5c
 	love.graphics.setCanvas(canvas)
Mystro256 3963d5c
-	love.graphics.clear(241, 232, 199, 255)
Mystro256 3963d5c
+	love.graphics.clear(0.945, 0.910, 0.780, 1)
Mystro256 3963d5c
 	love.graphics.setCanvas(c)
Mystro256 3963d5c
 
Mystro256 3963d5c
 	local w, h = self.customer.image:getDimensions()
Mystro256 3963d5c
diff --git a/ImageTools.lua b/ImageTools.lua
Mystro256 3963d5c
index b985e05..a04ec90 100644
Mystro256 3963d5c
--- a/ImageTools.lua
Mystro256 3963d5c
+++ b/ImageTools.lua
Mystro256 3963d5c
@@ -20,9 +20,9 @@ function ImageTools.histogram(data, steps)
Mystro256 3963d5c
 	for iy = 0, h-1 do
Mystro256 3963d5c
 		for ix = 0, w-1 do
Mystro256 3963d5c
 			local r, g, b = data:getPixel(ix, iy)
Mystro256 3963d5c
-			local ir = math.floor(r / 256 * steps)
Mystro256 3963d5c
-			local ig = math.floor(g / 256 * steps)
Mystro256 3963d5c
-			local ib = math.floor(b / 256 * steps)
Mystro256 3963d5c
+			local ir = math.floor(r * steps)
Mystro256 3963d5c
+			local ig = math.floor(g * steps)
Mystro256 3963d5c
+			local ib = math.floor(b * steps)
Mystro256 3963d5c
 			hist[ir][ig][ib] = hist[ir][ig][ib] + 1
Mystro256 3963d5c
 		end
Mystro256 3963d5c
 	end
Mystro256 3963d5c
diff --git a/Palette.lua b/Palette.lua
Mystro256 3963d5c
index d4afd6b..e7cad36 100644
Mystro256 3963d5c
--- a/Palette.lua
Mystro256 3963d5c
+++ b/Palette.lua
Mystro256 3963d5c
@@ -8,10 +8,10 @@ function Palette:initialize(x, y)
Mystro256 3963d5c
 	Entity.initialize(self, x, y, 2)
Mystro256 3963d5c
 
Mystro256 3963d5c
 	self.colors = {
Mystro256 3963d5c
-		{255, 255, 255},
Mystro256 3963d5c
-		{48, 213, 48},
Mystro256 3963d5c
-		{63, 127, 193},
Mystro256 3963d5c
-		{224, 54, 54}
Mystro256 3963d5c
+		{1, 1, 1},
Mystro256 3963d5c
+		{48/255, 213/255, 48/255},
Mystro256 3963d5c
+		{63/255, 127/255, 193/255},
Mystro256 3963d5c
+		{224/255, 54/255, 54/255}
Mystro256 3963d5c
 	}
Mystro256 3963d5c
 
Mystro256 3963d5c
 	self.selection = 1
Mystro256 3963d5c
@@ -88,7 +88,7 @@ function Palette:gui()
Mystro256 3963d5c
 	love.graphics.draw(self.image_mix, self.x+35, self.y+20)
Mystro256 3963d5c
 
Mystro256 3963d5c
 	if self.state == 2 then
Mystro256 3963d5c
-		love.graphics.setColor(0, 0, 0, 200)
Mystro256 3963d5c
+		love.graphics.setColor(0, 0, 0, 0.784)
Mystro256 3963d5c
 		love.graphics.rectangle("fill", 0, 0, WIDTH, HEIGHT)
Mystro256 3963d5c
 	end
Mystro256 3963d5c
 
Mystro256 3963d5c
@@ -96,9 +96,9 @@ function Palette:gui()
Mystro256 3963d5c
 		local x = self.x + Palette.static.PAINT_POS[i][1]
Mystro256 3963d5c
 		local y = self.y + Palette.static.PAINT_POS[i][2]
Mystro256 3963d5c
 
Mystro256 3963d5c
-		love.graphics.setColor(255, 255, 255)
Mystro256 3963d5c
+		love.graphics.setColor(1, 1, 1)
Mystro256 3963d5c
 		if i == self.selection then
Mystro256 3963d5c
-			love.graphics.setColor(255, 255, 255)
Mystro256 3963d5c
+			love.graphics.setColor(1, 1, 1)
Mystro256 3963d5c
 			love.graphics.draw(self.paint_highlights._image, self.paint_highlights._quads[i], x-1, y)
Mystro256 3963d5c
 		end
Mystro256 3963d5c
 
Mystro256 3963d5c
@@ -106,7 +106,7 @@ function Palette:gui()
Mystro256 3963d5c
 		love.graphics.draw(self.paint._image, self.paint._quads[i], x, y)
Mystro256 3963d5c
 	end
Mystro256 3963d5c
 
Mystro256 3963d5c
-	love.graphics.setColor(255, 255, 255)
Mystro256 3963d5c
+	love.graphics.setColor(1, 1, 1)
Mystro256 3963d5c
 end
Mystro256 3963d5c
 
Mystro256 3963d5c
 return Palette
Mystro256 3963d5c
diff --git a/Preferences.lua b/Preferences.lua
Mystro256 3963d5c
index 9ab61b2..12b802d 100644
Mystro256 3963d5c
--- a/Preferences.lua
Mystro256 3963d5c
+++ b/Preferences.lua
Mystro256 3963d5c
@@ -6,7 +6,7 @@ Preferences.static.path = "preferences"
Mystro256 3963d5c
 
Mystro256 3963d5c
 function Preferences.static:load()
Mystro256 3963d5c
 	self.data = {}
Mystro256 3963d5c
-	if love.filesystem.exists(self.path) == false then
Mystro256 3963d5c
+	if love.filesystem.getInfo(self.path) == nil then
Mystro256 3963d5c
 		print("Preference file \"".. self.path .. "\" not found")
Mystro256 3963d5c
 		return
Mystro256 3963d5c
 	end
Mystro256 3963d5c
diff --git a/Sound.lua b/Sound.lua
Mystro256 3963d5c
index a800c26..4e8cc88 100644
Mystro256 3963d5c
--- a/Sound.lua
Mystro256 3963d5c
+++ b/Sound.lua
Mystro256 3963d5c
@@ -12,7 +12,7 @@ function Sound.music(name)
Mystro256 3963d5c
 	if music ~= nil then
Mystro256 3963d5c
 		music:stop()
Mystro256 3963d5c
 	end
Mystro256 3963d5c
-	music = love.audio.newSource("data/music/" .. name)
Mystro256 3963d5c
+	music = love.audio.newSource("data/music/" .. name, "stream")
Mystro256 3963d5c
 	music:setVolume(0.5)
Mystro256 3963d5c
 	music:setLooping(true)
Mystro256 3963d5c
 	love.audio.play(music)
Mystro256 3963d5c
diff --git a/TitleController.lua b/TitleController.lua
Mystro256 3963d5c
index 4a0413a..b7bd4f9 100644
Mystro256 3963d5c
--- a/TitleController.lua
Mystro256 3963d5c
+++ b/TitleController.lua
Mystro256 3963d5c
@@ -80,12 +80,12 @@ function TitleController:gui()
Mystro256 3963d5c
 		love.graphics.print(v, 32+self.offsets[i], 22+i*28)
Mystro256 3963d5c
 
Mystro256 3963d5c
 		if self.active[i] then
Mystro256 3963d5c
-			love.graphics.setColor(255, 255, 255)
Mystro256 3963d5c
+			love.graphics.setColor(1, 1, 1)
Mystro256 3963d5c
 			love.graphics.print(v, 32+self.offsets[i], 20+i*28)
Mystro256 3963d5c
 		else
Mystro256 3963d5c
-			love.graphics.setColor(128, 128, 128)
Mystro256 3963d5c
+			love.graphics.setColor(0.5, 0.5, 0.5)
Mystro256 3963d5c
 			love.graphics.print(v, 32+self.offsets[i], 20+i*28)
Mystro256 3963d5c
-			love.graphics.setColor(255, 255, 255)
Mystro256 3963d5c
+			love.graphics.setColor(1, 1, 1)
Mystro256 3963d5c
 		end
Mystro256 3963d5c
 	end
Mystro256 3963d5c
 
Mystro256 3963d5c
diff --git a/conf.lua b/conf.lua
Mystro256 3963d5c
index dc26893..98e45e0 100644
Mystro256 3963d5c
--- a/conf.lua
Mystro256 3963d5c
+++ b/conf.lua
Mystro256 3963d5c
@@ -1,6 +1,6 @@
Mystro256 3963d5c
 function love.conf(t)
Mystro256 3963d5c
     t.identity = "dk.tangramgames.90secondportraits"
Mystro256 3963d5c
-    t.version = "0.10.0"
Mystro256 3963d5c
+    t.version = "11.0"
Mystro256 3963d5c
     t.console = false
Mystro256 3963d5c
     t.accelerometerjoystick = false
Mystro256 3963d5c
     t.gammacorrect = false
Mystro256 3963d5c
diff --git a/main.lua b/main.lua
Mystro256 3963d5c
index e513605..a54f067 100644
Mystro256 3963d5c
--- a/main.lua
Mystro256 3963d5c
+++ b/main.lua
Mystro256 3963d5c
@@ -116,7 +116,7 @@ function love.run()
Mystro256 3963d5c
 		Mouse.static:clear()
Mystro256 3963d5c
 		Keyboard.static:clear()
Mystro256 3963d5c
 
Mystro256 3963d5c
-		if love.window and love.graphics and love.window.isCreated() then
Mystro256 3963d5c
+		if love.window and love.graphics and love.window.isOpen() then
Mystro256 3963d5c
 			love.graphics.clear()
Mystro256 3963d5c
 			love.graphics.origin()
Mystro256 3963d5c
 			love.graphics.push()
Mystro256 3963d5c
diff --git a/mymath.lua b/mymath.lua
Mystro256 3963d5c
index 999ee74..84c6de0 100644
Mystro256 3963d5c
--- a/mymath.lua
Mystro256 3963d5c
+++ b/mymath.lua
Mystro256 3963d5c
@@ -17,7 +17,7 @@ function math.gauss()
Mystro256 3963d5c
 end
Mystro256 3963d5c
 
Mystro256 3963d5c
 function math.rgbtohsv(r, g, b, a)
Mystro256 3963d5c
-  r, g, b, a = r / 255, g / 255, b / 255, a / 255
Mystro256 3963d5c
+  r, g, b, a = r, g, b, a
Mystro256 3963d5c
   local max, min = math.max(r, g, b), math.min(r, g, b)
Mystro256 3963d5c
   local h, s, v
Mystro256 3963d5c
   v = max
Mystro256 3963d5c
@@ -58,7 +58,7 @@ function math.hsvtorgb(h, s, v, a)
Mystro256 3963d5c
   elseif i == 5 then r, g, b = v, p, q
Mystro256 3963d5c
   end
Mystro256 3963d5c
 
Mystro256 3963d5c
-  return r * 255, g * 255, b * 255, a * 255
Mystro256 3963d5c
+  return r, g, b, a
Mystro256 3963d5c
 end
Mystro256 3963d5c
 
Mystro256 3963d5c
 function math.huemid(a, b)
Mystro256 3963d5c
@@ -91,9 +91,6 @@ function math.subset(t, n)
Mystro256 3963d5c
 end
Mystro256 3963d5c
 
Mystro256 3963d5c
 function math.rgbtoyuv(r, g, b)
Mystro256 3963d5c
-	r = r / 255
Mystro256 3963d5c
-	g = g / 255
Mystro256 3963d5c
-	b = b / 255
Mystro256 3963d5c
 
Mystro256 3963d5c
 	local y = 0.299 * r + 0.587 * g + 0.114 * b
Mystro256 3963d5c
 	local u = 0.492 * (b - y)
Mystro256 3963d5c
@@ -104,8 +101,8 @@ end
Mystro256 3963d5c
 
Mystro256 3963d5c
 function math.rgbdistance(r1, g1, b1, r2, g2, b2)
Mystro256 3963d5c
 	local rmean = (r1 + r2) / 2
Mystro256 3963d5c
-	local r = r1 - r2
Mystro256 3963d5c
-	local g = g1 - g2
Mystro256 3963d5c
-	local b = b1 - b2
Mystro256 3963d5c
-	return math.sqrt((2 + rmean/256) * r^2 + 4*g^2 + (2 + (255 - rmean)/256)*b^2)
Mystro256 3963d5c
+	local r = r1*255 - r2*255
Mystro256 3963d5c
+	local g = g1*255 - g2*255
Mystro256 3963d5c
+	local b = b1*255 - b2*255
Mystro256 3963d5c
+	return math.sqrt((2 + rmean) * r^2 + 4*g^2 + (2 + (1 - rmean))*b^2)
Mystro256 3963d5c
 end
Mystro256 3963d5c
-- 
Mystro256 3963d5c
2.14.4
Mystro256 3963d5c