Refactor and rename: backends, cairo, contexts #129
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor:
color
fn:color : ?a:float -> int -> int -> int -> unit
(rgba color making function)rgb
fn:rgb : int -> int -> int -> unit
(rgb - opaque color making function. renamed and changed signature from opaque) - Color API: rename opaque #117color
type is nowint * int * int * float
(fromint * int * int
).Color.black
for all shapes, fill defaults toColor.transparent
context.ml
/render.ml
tobackend_cairo.ml
andmli
.draw_{anything}
functionsdraw_{anything}
functions (was running into a cycle dependency error without - maybe that was due to something else and it isn't needed now).background
->set_background
set_background
andset_line_width
takectx
as an arg : at the backend ctx levelcontext.ml
), this is not needed and the global default is usedtype context
is now a sum type overCairoBackend
,SVGBackend
, andLazyBackend
(Context API: support multiple types of contexts #119 )center
toorigin
inshape.ml
codeno_fill
andno_stroke
(it is the same aswith_stroke Color.transparent
andwith_fill Color.transparent
)line
toparallel_lines
and create a new simplerline
example