After defining certain colors and modifying them as the following code indicates, I then would like to determine the equivalent RGB definitions of the modified colors. For example, \documentclass{article} \usepackage{tikz} \newcommand{\mycbox}[1]{\tikz{\path[draw=#1,fill=#1] (0,0) rectangle (3cm,3cm);}}  \definecolor{red}{rgb}{1, 0, 0} \definecolor{blue}{rgb}{0, 0, 1} \definecolor{burntorange}{rgb}{0.8, 0.33, 0.0}  \begin{document}     \mycbox{red}      \mycbox{blue}     \mycbox{burntorange}          \vskip 30pt  \textbf{\LARGE{RGB Definitions of These Colors? ---}}  \vskip 15pt      \mycbox{red!80}      \mycbox{blue!60}     \mycbox{burntorange!65}     \mycbox{burntorange!55!red!80} \end{document}   How may I determine the exact RGB definitions of the four colors in the second row? Thank you.
121519
How to exactly convert an arithmetic rgb value (e.g 0.55,0.25,0.1) to the corresponding 8bit RGB value (e.g. 123,90,40)?  My more specific questions are:  1.) What is the exact conversion formula and macro?  2.) Is there some built in command or macro for converting it?
44540
I have an image (PNG or JPG) inside which there is at least one pixel of a certain RGB color I know in advance.  I want to find the pixel(s) of that color  For example, I may have image.jpg, inside which I know some pixel has the RGB value 255,100,200. I want a program that will give me the list of pixels (if any) of that color in the image.  Anyone know of a tool to help me with that?  Thanks!
31716
I'm confused about tikz pics. I can freely define them without issue, and even add coordinates inside that will be available by name inheritance like (-A) as for example in \pic (S) at (0,0) {myPic}; \draw (S-A) -- ++(0,0);. This is all documented around p. 255 of the pgf manual.  However I don' understand why it is not possible to give a name to a pic like the one above if no coordinate is defined inside it. By default it would be great if it could behave like a normal node.  MWE:  \documentclass{minimal} \usepackage{tikz}  \tikzset{     myBlock/.pic = {         \node[draw,minimum width=1cm,minimum height=0.5cm] at (0,0) {};     },     myBlockNamed/.pic = {         \node[draw,minimum height=1cm,minimum width=0.5cm] (-m) at (0,0) {};     }, }  \begin{document} \begin{tikzpicture}     \pic () at (0,0) {myBock}; % can't give it a name     \pic (S) at (3,0) {myBlockNamed}; % can give it a name     \draw (S-A) -- ++(2,0); \end{tikzpicture} \end{document}   The underlying point is I'm working on a control blocs library (so that we can stop the chat below with @Alenanno). For example here is the definition of a math operator  \tikzset{     mySum background/.style = {         circle, minimum size=1.5em, fill=white,     },     mySum edge/.style = {         draw=black, circle, minimum size=1.5em, line width=.5pt,     },     pics/bOp/.style = {     code = {       \node [mySum background] {};       \foreach \t [count=\i] in {#1}{         \pgfmathsetmacro{\angle}{\i*90}         \node[anchor=center, font=\tiny] at (\angle:0.45em) {$\t$};       }       \node [mySum edge] {};     },   }, }
900
Given an $n$-sided polygon, how many ways can you color the vertices using $k$ colors so that no two adjacent vertices have the same color?  (Inspired by 2011 AMC 12 A #16 – I'm able to do this for small cases but not in general.)
31396
I want to draw a bunch of nodes with different styles (a, b, ...) at different points (named 00, 01, ...). I am using the following code:  \foreach \n/\lst in {   a/{00, 14, 20, 34},   b/{01, 11, 23, 33} } {   \foreach \xy in \lst {     \node[\n] at (\xy) {\n};   } }   with the hope that \lst would be assigned a list, and \xy would be assigned elements from this list. However, I get error Package pgf Error: No shape named {01, 11, 23, 33}  is known. How to fix this?
30281
Why the shape (sB) is unknown in the following code ? How to avoid this ?  \documentclass[]{standalone} \usepackage{tikz,xparse} \usetikzlibrary{calc}  \tikzset{pics/.cd,     % Marque croix     Cross/.style args={#1 and #2}{%         code = {%         \draw[#2,rotate=45,scale=1.4] (0,#1 pt) -- (0,-#1 pt) ;         \draw[#2,rotate=-45,scale=1.4] (0,#1 pt) -- (0,-#1 pt) ;         }     },     Cross/.default={2 and black} }  \NewDocumentCommand{\Segment}{mO{}}{%     \begin{scope}[#2]     \path    (0,0) coordinate (sA) pic {Cross={1.5 and gray}}         -- (#1,0) coordinate (sB) pic {Cross={1.5 and gray}} ;     \draw (sA)--(sB) ; % Can't reuse (sB)     \end{scope} }   \begin{document}     \begin{tikzpicture}     \Segment{1.5}     \end{tikzpicture} \end{document}
38134
I have these squares that spin 90 degrees when the falloff passes over them, I want them to change color from blue to magenta at the same time, I've made this array to clone one and got the color to work but it's only effecting the first one since they are all using the same material. How do I do this?  I either want to color the emission node using the falloff  OR Change color along with the 90 degrees of rotation  Rendered in cycles  I would love some help with this! :)
30533
I am trying to plot a set of data points (scatter points not linked to each other), where each point has a different color. The color definition is given by predefined rgb values written in the same file that contains the data.  The following file serves as example:  \usepackage{filecontents} \begin{filecontents}{test.dat}     x   y   RED   GREEN   BLUE     1   11  0.2    0.3    0.5     2   14  0.3    0.3    0.4     4   26  0.1    0.8    0.1     3   39  0.0    0.1    0.9 \end{filecontents}   The x and y columns represent the position of the points I want to plot. The next three columns RED, GREEN and BLUE correspond to the associated color values in rgb format.  What I was trying so far, was to do:  \begin{document}  \pgfplotstableread{test.dat}\test %number of points to be plotted \pgfplotstablegetrowsof{\test} \pgfmathsetmacro{\N}{\pgfplotsretval-1}    \begin{tikzpicture} \begin{axis}[%     xmin=0, xmax=5,     ymin=0, ymax=45,     width=8cm,     height=6cm,     grid=both,     xlabel=Xtest,      ylabel=Ytest,        ]     \foreach \i in {0,...,\N}     {     \definecolor{testcolor}{rgb}{\thisrow{3}, \thisrow{4}, \thisrow{5}}        \addplot[scatter,          only marks,              scatter/use mapped color={draw=none,fill=testcolor},     ]      table [x index = 0,y index = 1]{\test};     } \end{axis} \end{tikzpicture}  \end{document}   But I am unable to fetch a single row value for the color definition. How can I do this ? I also looked at meta options, but the color is defined with a single value (linearly) and I need the three components in the color definition.
20941
As in , the code  \draw[step=0.5cm,color=gray] (-1,-1) grid (1,1);   gives me a nice finite 4x4 grid. But when I choose a different starting point, like  \draw[step=0.5cm,color=gray] (2,2) grid (4,4);   then the left and the bottom border of the grid disappears. What is the problem and how can I fix it so that I have all the borders? I know I can draw a rectangle there, but I assume there is some cleaner solution.
29608
Today I found something weird. When I use \selectcolormodel{} in a TikZ drawing the model is only applied to \fill and not to \draw[fill=]. Does anyone know why?  \documentclass{article}  %\usepackage[gray]{xcolor} % all draws or fills become gray \usepackage{xcolor} \usepackage{tikz}  \begin{document}  \begin{tikzpicture}      \draw [fill=cyan] (0,0) rectangle (1,1);     \fill [cyan] (2,0) rectangle (3,1);  \end{tikzpicture}  \selectcolormodel{gray}  \begin{tikzpicture}      \draw [fill=cyan] (0,0) rectangle (1,1); % expected this one to change     \fill [cyan] (2,0) rectangle (3,1);  \end{tikzpicture}  \end{document}   And the result is the one below.
22304
Hi All: I have a code snippet below which works beautifully and was provided by someone on this list to me a while back.  But now I want to change it so that I draw one long rectangle instead of the adjacent five boxes. The text inside the rectangle should just be at the far right of it and could say $Y^{*}_{whatever}$. I'm thinking that I need to define a rectnode instead of a squared node with different things in it.  But I don't understand how to make it the same length as the length of the boxes and in the same position. &quot;minimum size&quot; currently inside the definition of squarednode isn't making sense to me. EDIT: I have edited this question by including a handwritten drawing in order to express the fact that I need the rectangles to line up with the horizontal axis as shown. So, the first rectangle travels from 0 to 5. The second rectangle travels from 1 to 6, etc all the way to the 6th rectangle travelling from 5 to 10. Also, all the rectangles should be the same width and length even though it may not seem that way by the picture. I also don't need a y-axis. Thanks and I'm sorry for not being clearer the first time.  \begin{tikzpicture}[ squarednode/.style={draw=black, minimum size=9.9mm}, y=1.5cm ]    %boxes      \draw (0.5, 5.5) node[squarednode] {$X_{1}^{*}$};     \draw (1.5, 5.5) node[squarednode] {$X_{2}^{*}$};     \draw (2.5, 5.5) node[squarednode] {$X_{3}^{*}$};     \draw (3.5, 5.5) node[squarednode] {$X_{4}^{*}$};     \draw (4.5, 5.5) node[squarednode] {$X_{5}^{*}$};                  \draw (1.5, 4.5) node[squarednode] {$X_{2}^{*}$};     \draw (2.5, 4.5) node[squarednode] {$X_{3}^{*}$};     \draw (3.5, 4.5) node[squarednode] {$X_{4}^{*}$};     \draw (4.5, 4.5) node[squarednode] {$X_{5}^{*}$};     \draw (5.5, 4.5) node[squarednode,dashed] {0};      \draw (2.5, 3.5) node[squarednode] {$X_{3}^{*}$};     \draw (3.5, 3.5) node[squarednode] {$X_{4}^{*}$};     \draw (4.5, 3.5) node[squarednode] {$X_{5}^{*}$};     \draw (5.5, 3.5) node[squarednode,dashed] {0};     \draw (6.5, 3.5) node[squarednode,dashed] {0};          \draw (3.5, 2.5) node[squarednode] {$X_{4}^{*}$};     \draw (4.5, 2.5) node[squarednode] {$X_{5}^{*}$};     \draw (5.5, 2.5) node[squarednode,dashed] {0};     \draw (6.5, 2.5) node[squarednode,dashed] {0};     \draw (7.5, 2.5) node[squarednode,dashed] {0};          \draw (4.5, 1.5) node[squarednode] {$X_{5}^{*}$};     \draw (5.5, 1.5) node[squarednode,dashed] {0};     \draw (6.5, 1.5) node[squarednode,dashed] {0};     \draw (7.5, 1.5) node[squarednode,dashed] {0};     \draw (8.5, 1.5) node[squarednode,dashed] {0};          \draw (5.5, 0.5) node[squarednode,dashed] {0};     \draw (6.5, 0.5) node[squarednode,dashed] {0};     \draw (7.5, 0.5) node[squarednode,dashed] {0};     \draw (8.5, 0.5) node[squarednode,dashed] {0};     \draw (9.5, 0.5) node[squarednode,dashed] {0};                      \end{tikzpicture}
48885
I want to draw arrow with two colors, the resulted arrow should be filled by one color at the top and by other color at the bottom, like the following code do to a rectangle:  \draw[top color=blue,bottom color=green] (0,0) rectangle (2,1);   What should I do?
30263
I just read a book "Linear Algebra and Its Applications 4E" by David C. Lay. The book is (should be) LaTeX typeset. The matrix and equations are so nice, please see the following 3 examples:        It's so beautiful, so I want get the same effect inside my paper. Here is my code:   \usepackage{amsmath} \usepackage{colortbl} \newcommand\y{\cellcolor{clight2}} \definecolor{clight2}{RGB}{212, 237, 244}%  %%% \[A=\left[ \begin{array}{ccccc} \y 0 &amp; -3 &amp; -6 &amp; 4 &amp; 9 \\    -1 &amp; \y -2 &amp; -1 &amp; 3 &amp; 1 \\ -2 &amp; -3 &amp; 0 &amp; \y 3 &amp; -1 \\ 1 &amp; 4 &amp; 5 &amp; -9 &amp; -7      \end{array} \right]\]  \[A=\left[\begin{array}{cccccc} \rowcolor{clight2} 3 &amp; -9 &amp; 12 &amp; -9 &amp; 6 &amp; 15\\ 0 &amp; 2 &amp; -4 &amp; 4 &amp; 2 &amp; -6 \\ 0 &amp; 3 &amp; -6 &amp; 6 &amp; 4 &amp; -5 \end{array} \right]\]   And the result:     But how to add these arrows??
53780
I am trying to draw rectangles, each of which has a corresponding value, which will be mapped into a color from a color map based on the value. This is how I want the write the code. What is missing is the mapping from \myvalue to \mycolor.  \documentclass{standalone}  \usepackage{colortbl} \usepackage{pgfplots} \usepackage{pgfplotstable}  \pgfplotsset{compat=1.9}  \newcommand*{\ListOfRectanglesColor}{%   0/0/1/1/blue,   1/1/2/2/red, }  \newcommand*{\ListOfRectanglesValues}{%   0/0/1/1/0.3,   1/1/2/2/0.6, }  \begin{document} \begin{tikzpicture}   \foreach \sXa/\sYa/\sXb/\sYb/\mycolor in \ListOfRectanglesColor {     \fill[\mycolor] (\sXa, \sYa) rectangle (\sXb, \sYb);   }   %\foreach \sXa/\sYa/\sXb/\sYb/\myvalue in \ListOfRectanglesColor {   %  what code will define \mycolor as a color based on \myvalue?   %  and a specified color map?   %  \fill[\mycolor] (\sXa, \sYa) rectangle (\sXb, \sYb);   %} \end{tikzpicture} \end{document}   Edited in response to comment  Question: How do I map values to colors? I would appreciate it if the TeX code were commented so that I could understand how the code works.  For simplicity, the mapping function will be of the form  \valuetocolor{value-min}{value-max}{color-min}{color-max}{value}   The floating point numbers value-min and value-max will be mapped to two defined colors color-min and color-max respectively. We can assume that value-min ≤ value-max. I want to map the floating point number value to the linear interpolated value between color-min and color-max. More precisely, let λ be the value such that value = λ value-min + (1 - λ) value-max. Then I want \valuetocolor{value-min}{value-max}{color-min}{color-max}{value} to return the color λ color-min + (1 - λ) color-max.    Related TeX.SX Question  I am aware that there is a related question  where there is TeX code that accomplishes a mapping from value to color for a more complicated color map. Unfortunately, with my limited TeX/PGF knowledge, I can't understand how the code works.
82720
I viewed in this post  a solution to my question, but...    Are there any easier way (or alternative) to do this using colors?  Thank you. ------------------ edited after showed than it´s duplicate ------------- I think that there are many sols, but for example this is easy using a normal table without pgf...     I´m trying to adapt to similar colors to apply to the table probabilitiess
67951
I used several colors in my PS1 prompt such as   \033]01;31\] # pink \033]00m\]   # white \033]01;36\] # bold green \033]02;36\] # green \033]01;34\] # blue \033]01;33\] # bold yellow   Where can I find a list of the color codes I can use?  I looked at  but it didn't answer my question about a list of the actual codes.  It would be nice if there was a more readable form also.  See also
81941
The following has worked for me for quite some time.  \documentclass[11pt]{book} \usepackage[margin=1in]{geometry}             \geometry{letterpaper}                  \usepackage[parfill]{parskip}     \usepackage{tikz, pgf, calc} \usetikzlibrary{matrix, shapes, positioning, calc, decorations.pathreplacing, shapes.geometric, arrows}  \newcounter{Day}  \newcounter{pt}[Day]    % CORRECTNESS POINTS FOR HW RUBRICS \newcommand{\pt}[2]     % NUMBER OF POINTS, ITEM IN STARBURST     {#2\begin{tikzpicture}[remember picture, overlay]         \node (A) [starburst,              draw = red, opacity = .8,              fill = red!20, fill opacity = .2,              xshift = -.5*\widthof{#2},             yshift = .5*\heightof{#2}             ]             {\phantom{#2}};         \node (B) at (current page.west) {};         \path let \p1 = (A), \p2 = (B) in node [draw = red,              color = red] at (\x2+.625in,\y1) {#1 pt(s)};     \end{tikzpicture}     \addtocounter{pt}{#1}     }  \begin{document}  \pt{1}{lorem}  \end{document}   Recently, I updated several packages with MikTeX 2.9.  Below is a screenshot of the packages that were updated.    Since the updates, the \widthof and \heightof commands are causing errors.  If I change the xshift and yshift to something else, everything compiles just fine (but isn't the way I want my command to work).  I have two questions:   Why did this work before and not now? How can I change my code to make it work correctly again?   Thanks in advance for any help!