From 1cd71d7210e1fcde730c864e54a91b10084b2a5d Mon Sep 17 00:00:00 2001 From: Louis Dalibard Date: Tue, 24 Dec 2024 16:44:30 +0100 Subject: [PATCH] yes --- palette-generator/Stylix/Palette.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/palette-generator/Stylix/Palette.hs b/palette-generator/Stylix/Palette.hs index 0a06dac..c854338 100644 --- a/palette-generator/Stylix/Palette.hs +++ b/palette-generator/Stylix/Palette.hs @@ -34,17 +34,17 @@ randomFromImage image = do color = RGB (fromIntegral r) (fromIntegral g) (fromIntegral b) return $ rgb2lab color -instance Species (String, Image PixelRGB8) (V.Vector LAB) where - generate (_, image) = V.replicateM 16 $ randomFromImage image +instance Species (String,String,String, Image PixelRGB8) (V.Vector LAB) where + generate (_,_,_, image) = V.replicateM 16 $ randomFromImage image crossover _ a b = return $ alternatingZip a b - mutate (_, image) palette = do + mutate (_,_,_, image) palette = do index <- randomRIO (0, 15) colour <- randomFromImage image return $ palette // [(index, colour)] - fitness (polarity, _) palette + fitness (polarity_,_,, _) palette = realToFrac $ accentDifference - (primarySimilarity/10) - scheme where -- The primary scale should use similar colours, to an extent.