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.