From 9d2f2738aec5c2fde5ef2611d74554b49ebe57fb Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Fri, 15 Dec 2023 11:34:26 +0100 Subject: [PATCH] expose color definitions via header files (to be also used via tikz) --- src/plot_grammar.cc | 11 +---------- src/plot_grammar.hh | 46 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 src/plot_grammar.hh diff --git a/src/plot_grammar.cc b/src/plot_grammar.cc index f07dbb074..ec8055256 100644 --- a/src/plot_grammar.cc +++ b/src/plot_grammar.cc @@ -27,16 +27,7 @@ #include "const.hh" #include "fn_arg.hh" #include "fn_def.hh" - -static const char *COLOR_OVERLAY = "#cc5555"; -static const char *COLOR_INDICES = "#555555"; -static const char *COLOR_FILTER = "magenta"; -static const char *COLOR_TYPE = "orange"; -static const char *COLOR_TERMINAL = "blue"; -static const char *COLOR_ALGFCT = "green"; -static const char *COLOR_NONTERMINAL = "black"; -static const char *COLOR_BLOCK = "gray"; -static const char *COLOR_EVALFCT = "purple"; +#include "plot_grammar.hh" // a mechanism to properly indent dot code static int indent_depth = 0; diff --git a/src/plot_grammar.hh b/src/plot_grammar.hh new file mode 100644 index 000000000..a7165249b --- /dev/null +++ b/src/plot_grammar.hh @@ -0,0 +1,46 @@ +/* {{{ + + This file is part of gapc (GAPC - Grammars, Algebras, Products - Compiler; + a system to compile algebraic dynamic programming programs) + + Copyright (C) 2008-2011 Georg Sauthoff + email: gsauthof@techfak.uni-bielefeld.de or gsauthof@sdf.lonestar.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +}}} */ + + +#ifndef SRC_PLOT_GRAMMAR_HH_ +#define SRC_PLOT_GRAMMAR_HH_ + + +/* color definitions for grammar plots as well as tikZ candidate trees. + * As tikZ's latex syntax requires an [HTML] parameter for color definitions, + * we cannot use mixed encoding (names & hex), which works well for graphViz, + * though. + */ + +static const char * const COLOR_OVERLAY = "#cc5555"; // "brown" +static const char * const COLOR_INDICES = "#555555"; // "light gray" +static const char * const COLOR_FILTER = "#fc02fc"; // "magenta" +static const char * const COLOR_TYPE = "#fca604"; // "orange" +static const char * const COLOR_TERMINAL = "#0402fc"; // "blue" +static const char * const COLOR_ALGFCT = "#14fe14"; // "green" +static const char * const COLOR_NONTERMINAL = "#0c0a0c"; // "black"; +static const char * const COLOR_BLOCK = "#c4c2c4"; // "gray"; +static const char * const COLOR_EVALFCT = "#a42af4"; // "purple" + + +#endif /* SRC_PLOT_GRAMMAR_HH_ */