Comment

Comment by ImJasonH

Some Go API style nits:

- it's unusual to pass a map with expected keys like this. Normally you'd pass a struct like: p := New(Options{ BaseColor: "...", Color: "...", Generator: "...", })

- You could define the known patterns as constants so they're documented and so users don't have to worry about typos

- Field names are normally camel-case without underscores, e.g., "Base_color" should be "BaseColor"

- You could use Go's build-in image/color package instead of accepting RGB strings, but that's more of a judgement call.

If you're accepting pull requests I might send you some, but they're breaking API changes so it's up to you.

All-in-all though it's a cool project and I'm glad to see it in Go :)

parent ImJasonH 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton