yes
This commit is contained in:
parent
c4930a5629
commit
1cd71d7210
@ -34,17 +34,17 @@ randomFromImage image = do
|
|||||||
color = RGB (fromIntegral r) (fromIntegral g) (fromIntegral b)
|
color = RGB (fromIntegral r) (fromIntegral g) (fromIntegral b)
|
||||||
return $ rgb2lab color
|
return $ rgb2lab color
|
||||||
|
|
||||||
instance Species (String, Image PixelRGB8) (V.Vector LAB) where
|
instance Species (String,String,String, Image PixelRGB8) (V.Vector LAB) where
|
||||||
generate (_, image) = V.replicateM 16 $ randomFromImage image
|
generate (_,_,_, image) = V.replicateM 16 $ randomFromImage image
|
||||||
|
|
||||||
crossover _ a b = return $ alternatingZip a b
|
crossover _ a b = return $ alternatingZip a b
|
||||||
|
|
||||||
mutate (_, image) palette = do
|
mutate (_,_,_, image) palette = do
|
||||||
index <- randomRIO (0, 15)
|
index <- randomRIO (0, 15)
|
||||||
colour <- randomFromImage image
|
colour <- randomFromImage image
|
||||||
return $ palette // [(index, colour)]
|
return $ palette // [(index, colour)]
|
||||||
|
|
||||||
fitness (polarity, _) palette
|
fitness (polarity_,_,, _) palette
|
||||||
= realToFrac $ accentDifference - (primarySimilarity/10) - scheme
|
= realToFrac $ accentDifference - (primarySimilarity/10) - scheme
|
||||||
where
|
where
|
||||||
-- The primary scale should use similar colours, to an extent.
|
-- The primary scale should use similar colours, to an extent.
|
||||||
|
Loading…
Reference in New Issue
Block a user