TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use the color of a path to set the color of the nodes. But I want the nodes to be lighter than the path color. And I want to do this before knowing what the path color will be. Hence, how do i get what will be active path color, so that I can adjust the node color?

share|improve this question
Could you give a hypothetical example of what you'd like to be able to write? I'm finding it hard to envision a case where the node does not know the colour of the path that it is on. – Loop Space May 5 '11 at 12:31
@Andrew: if the color is declared (then changed) in a style, the \draw[style] command may not know what color that is. – Matthew Leingang May 5 '11 at 17:27
@Matthew: I was thinking of hacking in to the lower level code and having the node look at the macro that holds the path's colour. – Loop Space May 5 '11 at 18:20

TikZ/PGF uses xcolor to store and manipulate color values. With xcolor the current color is always available as .. So, you can write


        \fill[radius=1cm] circle 
            node[font={\bf\huge}] {\color{.!20}text};

to obtain


share|improve this answer
Very useful!! – Matthew Leingang May 5 '11 at 17:25
@Matthew: Also have a look on \blendcolors. You might find it also very useful. However IIRC it doesn't work for the current color just for subsequent ones. – Martin Scharrer May 5 '11 at 18:29
Thank you @peter and @PeterSmith for your comments! Here the problem in more detail: – kunzo May 6 '11 at 9:49
Here is a sample that illustrates what I get \documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{matrix,shapes} \definecolor{currentPathcolor}{rgb}{0.8 0.4 0.2} \tikzstyle{pathstyle}=[>=latex,>->,dashed] \tikzstyle{nodestyle}=[ellipse,inner sep=1pt,text=black,fill=.!20] \tikzstyle{nodestyleX}=[ellipse,inner sep=1pt,text=black,fill=currentPathcolor!20] \tikzstyle{mystyle}=[scale= .5, baseline=(current bounding box.center), style1/.style={ out=45,in=120,distance=3cm, line width=1.1pt}, style2/.style={ out=-45,in=-120,distance=3cm, min distance=2cm, line width=1.1pt} ] – kunzo May 6 '11 at 9:55
@kunzo: Please add the example to your question. This is unreadable. – Caramdir May 6 '11 at 16:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.