Encourage primary scale to be similar colours 👔

This commit is contained in:
Daniel Thwaites 2022-07-01 14:38:10 +01:00
parent ffc2b3f447
commit 23033265c8

View file

@ -57,8 +57,14 @@ instance (Floating a, Real a) => Species (String, (V.Vector (LAB a))) (V.Vector
in (generator'', palette // [(index, colour)])
fitness (polarity, _) palette
= realToFrac $ accentDifference - scheme
= realToFrac $ accentDifference - (primarySimilarity/10) - scheme
where
-- The primary scale should use similar colours, to an extent.
primarySimilarity = maximum $ do
a <- primary palette
b <- primary palette
return $ deltaE a b
-- The accent colours should be as different as possible.
accentDifference = minimum $ do
a <- accent palette