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