diff --git a/palette-generator/Stylix/Main.hs b/palette-generator/Stylix/Main.hs index a0c89e4..ea4c38b 100644 --- a/palette-generator/Stylix/Main.hs +++ b/palette-generator/Stylix/Main.hs @@ -22,16 +22,18 @@ mainProcess (polarity,primaryScaleDark,primaryScaleLight, input, output) = do setStdGen $ mkStdGen 0 image <- loadImage input - palette <- evolve (polarity, primaryScaleDark, primaryScaleLight, convertRGB8 image) + palette <- evolve (polarity, convertRGB8 image) let outputTable = makeOutputTable $ V.map lab2rgb palette writeFile output $ encode outputTable putStrLn $ "Saved to " ++ output -parseArguments :: [String] -> Either String (String, String, String) -parseArguments [polarity, input, output] = Right (polarity, input, output) -parseArguments [_, _] = Left "Please specify an output file" -parseArguments [_] = Left "Please specify an image" +parseArguments :: [String] -> Either String (String, Float,Float,String, String) +parseArguments [polarity, primaryScaleDark, primaryScaleLight,input, output] = Right (polarity,primaryScaleDark, primaryScaleLight, input, output) +parseArguments [_, _,_,_] = Left "Please specify an output file" +parseArguments [_, _,_] = Left "Please specify an image" +parseArguments [_, _] = Left "Please specify a primary scaling factor for the light polarity" +parseArguments [_] = Left "Please specify a primary scaling factor for the dark polarity" parseArguments [] = Left "Please specify a polarity: either, light or dark" parseArguments _ = Left "Too many arguments"