Created
June 6, 2018 13:08
-
-
Save 5outh/7c47dd303f159d964360a2c1d7bbd8cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderSketch :: Generate () | |
renderSketch = do | |
fillScreenHsv linen | |
cairo $ setLineJoin LineJoinRound | |
cairo $ setLineCap LineCapRound | |
cairo $ setLineWidth 0.1 | |
xScale <- sampleRVar (D.uniform 0 3) | |
yScale <- sampleRVar (D.uniform 0 3) | |
for_ [6,9..91] $ \x' -> do | |
points <- replicateM (1000 + round x' * 2000) $ do | |
y <- sampleRVar (D.uniform 10 70) | |
x <- (+ (sin y * yScale)) <$> sampleRVar (pareto x' (1.5*x')) | |
pure (V2 (y + (sin x * xScale)) x) | |
cairo . for_ points $ \p -> do | |
drawV2 0.025 p | |
setSourceHsv charcoal *> fill | |
render :: IO () | |
render = mainIOWith (\opts -> opts{ optWidth = 8 * 10, optHeight = 10 * 10 }) renderSketch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment