Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f633fb9
commit 5d51653
Showing
4 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
module Propane | ||
( module Propane.Types | ||
, module Propane.Helpers | ||
, module Propane.Raster | ||
, module Propane.IO | ||
, module Propane.Helpers | ||
, module Propane.Colour | ||
) where | ||
|
||
import Propane.Types | ||
import Propane.Helpers | ||
import Propane.Raster | ||
import Propane.IO | ||
import Propane.Helpers | ||
import Propane.Colour |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
module Propane.Colour | ||
( BaseColour | ||
, opaque, transparent, withOpacity | ||
, blend, over, darken, dissolve | ||
) where | ||
|
||
import qualified Data.Colour as C | ||
|
||
import Propane.Types | ||
|
||
type BaseColour = C.Colour R | ||
|
||
opaque :: BaseColour -> Colour | ||
opaque = C.opaque | ||
|
||
withOpacity :: BaseColour -> R -> Colour | ||
withOpacity = C.withOpacity | ||
|
||
transparent :: Colour | ||
transparent = C.transparent | ||
|
||
blend :: R -> Colour -> Colour -> Colour | ||
blend = C.blend | ||
|
||
over :: Colour -> Colour -> Colour | ||
over = C.over | ||
|
||
darken :: R -> Colour -> Colour | ||
darken = C.darken | ||
|
||
dissolve :: R -> Colour -> Colour | ||
dissolve = C.darken |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import Propane | ||
import Data.Colour | ||
import Data.Colour.Names | ||
|
||
main = saveImage "out.png" (Size 400 400) (const (opaque green)) |
This file contains 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