diff options
author | Camil Staps | 2015-08-19 11:07:55 +0200 |
---|---|---|
committer | Camil Staps | 2015-08-19 11:07:55 +0200 |
commit | 6b66ad843b6798d1a1910760c18d567f83d06bc8 (patch) | |
tree | e38aed893f4ef2453e0c3e3e440457bdcfeda683 /drawingframe.icl | |
parent | License, readme (diff) |
Setting up
Diffstat (limited to 'drawingframe.icl')
-rw-r--r-- | drawingframe.icl | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drawingframe.icl b/drawingframe.icl index 00e2862..73164d7 100644 --- a/drawingframe.icl +++ b/drawingframe.icl @@ -29,15 +29,15 @@ where maxdomain = {x=origin.x+size.w,y=origin.y+size.h} // Rainbow -//example pict = foldr id pict [fill {corner1={x=x1 * w,y=0},corner2={x=x1 * w + w,y=h}} o (setPenColour (rainbow (toReal x1 / 5.0))) \\ x1 <- [0..160]] -//where -// w = 5 -// h = 100 -// rainbow :: a -> Colour | toReal a -// rainbow i = let i` = toReal i -// f = 0.3 in RGB { r = toInt (sin (f * i` + 0.0) * 127.0) + 128, // http://krazydad.com/tutorials/makecolors.php -// g = toInt (sin (f * i` + PI / 1.5) * 127.0) + 128, -// b = toInt (sin (f * i` + PI / 0.75) * 127.0) + 128 } +example pict = foldr id pict [fill {corner1={x=x1 * w,y=0},corner2={x=x1 * w + w,y=h}} o (setPenColour (rainbow (toReal x1 / 5.0))) \\ x1 <- [0..160]] +where + w = 5 + h = 100 + rainbow :: a -> Colour | toReal a + rainbow i = let i` = toReal i + f = 0.3 in RGB { r = toInt (sin (f * i` + 0.0) * 127.0) + 128, // http://krazydad.com/tutorials/makecolors.php + g = toInt (sin (f * i` + PI / 1.5) * 127.0) + 128, + b = toInt (sin (f * i` + PI / 0.75) * 127.0) + 128 } // Points //example = drawPointAt zero o (setPenSize 1) |