To create or not to create a new type

Next time you may want to have a look at the Gg.Color module which has a few standard color spaces conversions.

1 Like

dbuenzli to the rescue! You seem to have written better versions of anything I have, and published them. I was just looking at my crusty old Color module (written 12 years ago, based on 25yo C code)ā€¦ considering how to spruce it up for sharing.

I had tried searching for ā€œocaml colorspaceā€ to see if there might be anything currently fitting the role, and I didnā€™t see Gg.Colorā€¦ which is slightly alarming. Searching on ocaml.org does a bit better, with ā€œgg.0.9.3ā€ showing up a few places down, though itā€™s not very clear that that would be what oneā€™s looking for. And now I tried ā€œopam search colorā€ and while gg also shows up (good!), itā€™s also hard to tell that it would be relevant from the one-line description. I donā€™t know how to improve this discoverability ā€“ just reporting what Iā€™m seeing. I basically wouldnā€™t know without you showing up to tell me: ā€œHey, you might like this!ā€

Actually my message was rather for @EmileTrotignon who didnā€™t find writing color conversions fun (I did !). But in any case according to the release notes you couldnā€™t have found gg 12 years ago.

Very nice module. I do not see an easy way to plug such colors into graphics. It should be quite easy to do anyway, but using Gg to complement Graphics would be my first reflex. I know Graphics is pretty raw, but it very easy to access. Maybe there is an improved version with a nicer api somewere though, and I have a feeling you would know

Not really when I need to do graphics I turn to Vg which depends on Gg but we are getting OT.

1 Like