I have a custom palette which I want to paint with it by indexing.
Here is my attempt:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\def\colorPallete{{0.00 0.00 0.52, 0.00 0.77 1.00, 1.00 0.98 0.00, 0.73 0.00 0.00}}
\foreach \x [count=\n] in {0,...,3}{%
\definecolor{currentColor}{rgb}{{\colorPallete[\x]}}
\fill [fill=currentColor] (\n,-2) circle[radius=.3];
}
\end{tikzpicture}
\end{document}
The problem is that the parser cannot deal with the rgb triplet, because if I use a similar array indexation to modify some other parameter like int the following example it works.
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\def\radiousCollection{{.1, .2, .3, .4}}
\foreach \x [count=\n] in {0,...,3}{%
\fill [fill=black] (\n,-2) circle[radius={\radiousCollection[\x]}];
}
\end{tikzpicture}
\end{document}

A possible workaround is to split the three planes of the color palette into three different arrays then the indexation works as in the case of the radious.
\documentclass{standalone}
\usepackage{tikz}
\begin{document}\tiny
\begin{tikzpicture}
\def\colorPalleteR{{0.00, 0.00, 1.00, 0.73}}
\def\colorPalleteG{{0.00, 0.77, 0.98, 0.00}}
\def\colorPalleteB{{1.0, 1.00, 0.00,0.00}}
\foreach \x [ count=\n,
evaluate=\x as \myRval using ({\colorPalleteR[\x]}),
evaluate=\x as \myGval using ({\colorPalleteG[\x]}),
evaluate=\x as \myBval using ({\colorPalleteB[\x]}) ] in {0,...,3}{%
\definecolor{MyColor}{rgb}{\myRval,\myGval,\myBval}
\fill [fill=MyColor] (\n,0) circle[radius=.3];
\draw (\n,.8) node {R=\myRval}
(\n,.6) node {G=\myGval}
(\n,.4) node {B=\myBval};
}
\end{tikzpicture}
\end{document}

Can anyone explain how shall be used in order to parse vectors properly so that there is no need to split the palette by planes?

"0.00 0.00 0.52"? I'm updating the answer. – someonr Nov 24 '13 at 19:03{\colorPallete[\x]}and it requires to force the parser by using\pgfmathparse{\colorPallete[\x]}orevaluate=\x as \myColor using ({\colorPallete[\x]})– Sik Nov 24 '13 at 19:25