Skip to content

Commit

Permalink
use external color definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanssen2 committed Dec 15, 2023
1 parent 9d2f273 commit ade6a07
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/signature.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "statement.hh"
#include "expr/new.hh"
#include "type/backtrace.hh"
#include "plot_grammar.hh"


Signature_Base::~Signature_Base() {}
Expand Down Expand Up @@ -426,8 +427,10 @@ struct Generate_TikZ_Stmts : public Generate_Stmts {
} else {
f = new Statement::Fn_Call(Statement::Fn_Call::STR_APPEND);
f->add_arg(*cur);
f->add_arg(new Expr::Const("\\\\color{blue} "));
f->add_arg(new Expr::Const(13));
std::string *color = new std::string(COLOR_TERMINAL);
f->add_arg(new Expr::Const(std::string("\\\\color[HTML]{") + \
color->substr(1, color->size()-1) + std::string("} ")));
f->add_arg(new Expr::Const(21));
l.push_back(f);
}

Expand Down Expand Up @@ -534,7 +537,9 @@ struct Generate_TikZ_Stmts : public Generate_Stmts {
Statement::Fn_Call *f = new Statement::Fn_Call(
Statement::Fn_Call::STR_APPEND);
f->add_arg(*ret);
std::string t = "node {\\\\color{green} " + *fn.name + "} ";
std::string *color = new std::string(COLOR_ALGFCT);
std::string t = "node {\\\\color[HTML]{" + \
color->substr(1, color->size()-1) + "} " + *fn.name + "} ";
f->add_arg(new Expr::Const(t));
f->add_arg(new Expr::Const(static_cast<int>(t.size()) -1));
fn.stmts.push_back(f);
Expand Down

0 comments on commit ade6a07

Please sign in to comment.