ggorlen / prettybt

simple binary tree visualizer
https://ggorlen.github.io/prettybt/
11 stars 3 forks source link

add light/dark color modes for the canvas #4

Closed zhouhaoyiu closed 1 year ago

zhouhaoyiu commented 2 years ago

3

ggorlen commented 2 years ago

Thanks for the PR! Giving users a bit more color control makes sense, but I think I'd prefer to simply add the stroke color as a parameter and leave concepts like "night mode" up to the client code to define as they see fit, rather than baking them into the PBT interface.

But then the font should probably be a parameter as well... Then there are enough parameters that it should probably be a config object. So it's a bit of a slippery slope, and my original intent wasn't to provide a huge array of options/features, just a quick n' dirty viz.

zhouhaoyiu commented 2 years ago

How about this commit? test

zhouhaoyiu commented 2 years ago

I tested the export function and it seems to work

P. S: Currently, the function of getinvertcolor only supports complete hexadecimal color codes and I add a validator.

I don't think we need to worry about a large number of parameters. We can add presets so that people can use them easily

ggorlen commented 2 years ago

Something like this should work. I'll take a closer look at the code and make a few tweaks when I get the chance.

zhouhaoyiu commented 2 years ago

Thanks and I created branch named url in my fork repository that can parse URL parameters.

The contact in your homepage is gsgorlen@gmail.com? Can I make friends with you ? 😄😄😄

ggorlen commented 1 year ago

Thanks again for the PR and apologies for the long delay. I decided to deal with the color problem in a different way using an options object (see https://github.com/ggorlen/prettybt/pull/8), but this was helpful to provide ideas, some of which I'd like to revisit in the future.