3 #ifndef CUSTOMCOLORGL_INCLUDED
4 #define CUSTOMCOLORGL_INCLUDED
12 namespace GLTutorials {
18 inline T FindFreeCustomColorIndex(T start = 1000)
22 ::Error(
"FindFreeCustomColorIndex",
"gROOT is null");
28 for (Int_t i = std::max(start, T(1000)), e = 10000; i < e; ++i)
29 if (!gROOT->GetColor(i))
32 ::Error(
"FindFreeCustomColorIndex",
"no index found");
39 template <
typename T,
unsigned N>
40 inline unsigned FindFreeCustomColorIndices(T (&indices)[N])
44 tmp[0] = FindFreeCustomColorIndex<T>();
49 for (; nFound < N; ++nFound) {
50 tmp[nFound] = FindFreeCustomColorIndex(tmp[nFound - 1] + 1);
51 if (tmp[nFound] == -1)
56 std::copy(tmp, tmp + N, indices);