Closed Niceplace closed 1 year ago
Hello @Niceplace! baseColor
is used for generating random color.
Currently, there's only one background composer - which generates solid color background.
Solid background generator selects color by its color preset mode see this.
(If given ColorPreset
has baseColor
only, geo-pattern assumes that mode as ColorPresetMode.BaseColor
see this)
Then, Generating Color is delegated to ColorGenerator. Currently, Choosing ColorGenerator is decided by checking mode
of ColorPreset
instance. and There are two ColorGenerator implementation.
You can test that behavior by using online demo of geo-pattern - https://mooyoul.github.io/geo-pattern/ Please note testing that behavior needs some manual work - BaseColor Checkbox toggle won't work unless you manually set color.
Hello ! I am using your library in a personal project to generate nice backgrounds for my app and I am testing out some things. I can successfully generate patterns and limit the color space using the "color" parameter when generating the pattern but I don't understand what
baseColor
does.Based on this: https://github.com/mooyoul/geo-pattern/blob/master/src/color-preset.ts#L14 is it correct to assume that the baseColor is returned by default if
color
is not specified ? :thinking:Cheers and thanks for porting this lib, I had my eyes on the original ruby implementation for years and I am happy I finally have a project to use it in