[apps/escher] Share color selection for data (Red, blue, Green, Yellow)

This commit is contained in:
Léa Saviot
2018-05-29 14:03:22 +02:00
parent df9be81ce7
commit 47fa6f4a41
13 changed files with 40 additions and 54 deletions

View File

@@ -70,4 +70,20 @@ void FunctionStore::tidy() {
}
}
const KDColor FunctionStore::firstAvailableColor() {
for (int k = 0; k < maxNumberOfFunctions(); k++) {
int j = 0;
while (j < m_numberOfFunctions) {
if (functionAtIndex(j)->color() == Palette::DataColor[k]) {
break;
}
j++;
}
if (j == m_numberOfFunctions) {
return Palette::DataColor[k];
}
}
return Palette::DataColor[0];
}
}