diff --git a/lib/joy.ml b/lib/joy.ml index 8337e4d..c2f3b4e 100644 --- a/lib/joy.ml +++ b/lib/joy.ml @@ -1,39 +1,9 @@ -let context = Context.context - -type 'a point = 'a Shape.point -type shape = Shape.shape -type shapes = Shape.shapes -type transformation = Transform.transformation +include Shape +include Transform +include Color -type color = Color.color -(** Three-tuple representing a 24-bit RGB color *) +let context = Context.context -let black = Color.black -let white = Color.white -let red = Color.red -let green = Color.green -let blue = Color.blue -let yellow = Color.yellow -let transparent = Color.transparent -let opaque = Color.opaque -let point = Shape.point -let circle = Shape.circle -let rectangle = Shape.rectangle -let polygon = Shape.polygon -let ellipse = Shape.ellipse -let line = Shape.line -let complex = Shape.complex -let with_stroke = Shape.with_stroke -let with_fill = Shape.with_fill -let no_stroke = Shape.no_stroke -let no_fill = Shape.no_fill -let rotate = Transform.rotate -let scale = Transform.scale -let translate = Transform.translate -let compose = Transform.compose -let repeat = Transform.repeat -let map_fill = Transform.map_fill -let map_stroke = Transform.map_stroke let set_line_width = Context.set_line_width let init ?(background = Color.white) ?(line_width = 2) ?(size = (500, 500)) diff --git a/lib/render.ml b/lib/render.ml index 9c67d1b..76ffa54 100644 --- a/lib/render.ml +++ b/lib/render.ml @@ -83,6 +83,7 @@ let draw_polygon ctx { vertices; stroke; fill } = Option.iter fill_rect fill; Cairo.Path.clear ctx.ctx + (* Validates context before rendering *) let show shapes = let rec render ctx = function