abey79 / vsketch

Generative plotter art environment for Python
https://vsketch.readthedocs.io/en/latest/
Other
492 stars 50 forks source link

Set line color #51

Open roblourens opened 3 years ago

roblourens commented 3 years ago

It would be great if I could customize the stroke color. Otherwise it's hard to use this with Jupyter in dark mode, or vscode notebooks, which use a dark theme by default.

image

I see color_mode but that doesn't quite do what I need.

abey79 commented 3 years ago

Thanks for your feedback. This is indeed on the roadmap, although I haven't yet figured out the details on how/when it'll happen.

Related to abey79/vpype#35

ademuri commented 3 years ago

I'm also interested in this. Reading through abey79/vpype#35, it seems like this might be a viable approach?

The design required for the linked issue looks complicated, so I'm hoping that implementing just this piece would be easier. If this is the right approach, or there is another approach that skirts the broader design questions, I'm happy to take a stab at it and submit a pull request.

abey79 commented 3 years ago

@ademuri @roblourens Do you consider important that the SVG background be black? One quick workaround would be to set the SVG background to white, until proper support comes via abey79/vpype#35.

Side question: do you see yourselves sticking to the jupyter environment now that I added vsk?

ademuri commented 3 years ago

My use case is different than OP's. I use vsk. I would like to be able to set colors (and background) because I'm doing white-on-black and multi-color plotting, and want preview and export SVG to match the colors I'll use.

abey79 commented 3 years ago

If I understand correctly, abey79/vpype#213 would then partially cover your use case, except:

1) export SVG would not have the correct colour (just the viewer) 2) for vsketch, the "selected theme" would need to be remembered on a sketch by sketch basis instead of globally (no big deal to implement)

How important having the right colours in the SVG is, compared to having the ability to preview correct colours in the viewer?

ademuri commented 3 years ago

Yep, that'd be nice to have. Previewing the correct colors in the viewer is more important - I can always manually change the colors in the SVG.

abey79 commented 3 years ago

Just curious: what is the reason SVG colours are important to you (assuming its used as plotting file)?

roblourens commented 3 years ago

Just because it would be a better experience to work with a preview in Jupyter Lab (or a jupyter notebook in vscode) when a dark theme is used.

abey79 commented 3 years ago

@roblourens of course for Jupyter it makes sense. Do you plan on sticking to Jupyter or move to vsk?

roblourens commented 3 years ago

I have an ulterior motive which is that I am on the vscode team working on notebooks, and I wanted to use that environment for sketches 😁

abey79 commented 3 years ago

Fair enough 😃

ademuri commented 3 years ago

Yes, I use the SVGs as plotting files. I want to specify the colors so when I e.g. share on PlotterFiles it matches my "creative vision".

eth0izzle commented 3 years ago

+1. My use case is displaying the plot simulation on screen for a client before plotting -- "why is it blue?". For now I'm simply opening the SVG and replacing "#00f" with "#000", e.g. sed -i 's/#00f/#000/g' plot.svg

JupyterJones commented 1 year ago

eth0izzle has got it. The fill also can be controlled from none to a color: sed -i 's/none/#fff000/g' plot.svg