seamia / protodot

transforming your .proto files into .dot files (and .svg, .png if you happen to have graphviz installed)
BSD 3-Clause "New" or "Revised" License
408 stars 39 forks source link

How to change colors? #3

Closed n8gray closed 4 years ago

n8gray commented 4 years ago

This project is really awesome, but I'd like to change the colors to something a bit easier to read. In config.json there are a bunch of colors listed, but I have no idea where the listed colors come from or how to specify new colors by hex value. I tried "#8888ff" and "8888ff", but neither way worked. Any documentation or advice would be appreciated. Thanks!

seamia commented 4 years ago

Hi Nathan,

thank you for your interest.

here is how you can change the colors used:

  1. copy config.json into n8gray.config
  2. inside n8gray.config find section "colors", there you will find colors used and their "translation"
  3. let's say you want to change the background of the service block header - change "enum.header": "paired9:3", to "service.header": "#ffffff", (the result of your modifications needs to be a valid JSON file, ... kinda obvious =)
  4. run protodot with you configuration, e.g. protodot -config n8gray.config -src source.proto -output resulting.dot

hope this helps

=)