diff --git a/apps/shared/storage_cartesian_function.cpp b/apps/shared/storage_cartesian_function.cpp index fe9c84f16..d79aeb633 100644 --- a/apps/shared/storage_cartesian_function.cpp +++ b/apps/shared/storage_cartesian_function.cpp @@ -42,9 +42,11 @@ void StorageCartesianFunction::DefaultName(char buffer[], size_t bufferSize) { } StorageCartesianFunction StorageCartesianFunction::NewModel(Ion::Storage::Record::ErrorStatus * error, const char * baseName) { + static int s_colorIndex = 0; // Create the record char nameBuffer[SymbolAbstract::k_maxNameSize]; - CartesianFunctionRecordData data; + int numberOfColors = sizeof(Palette::DataColor)/sizeof(KDColor); + CartesianFunctionRecordData data(Palette::DataColor[s_colorIndex++ % numberOfColors]); if (baseName == nullptr) { DefaultName(nameBuffer, SymbolAbstract::k_maxNameSize); baseName = nameBuffer; diff --git a/apps/shared/storage_cartesian_function.h b/apps/shared/storage_cartesian_function.h index f48eef1e8..107a0c534 100644 --- a/apps/shared/storage_cartesian_function.h +++ b/apps/shared/storage_cartesian_function.h @@ -28,8 +28,8 @@ public: protected: class CartesianFunctionRecordData : public FunctionRecordData { public: - CartesianFunctionRecordData() : - FunctionRecordData(), + CartesianFunctionRecordData(KDColor color) : + FunctionRecordData(color), m_displayDerivative(false) {} bool displayDerivative() const { return m_displayDerivative; } diff --git a/apps/shared/storage_function.cpp b/apps/shared/storage_function.cpp index 6fd65efd8..57b835642 100644 --- a/apps/shared/storage_function.cpp +++ b/apps/shared/storage_function.cpp @@ -25,10 +25,6 @@ void StorageFunction::setActive(bool active) { recordData()->setActive(active); } -void StorageFunction::setColor(KDColor color) { - recordData()->setColor(color); -} - int StorageFunction::nameWithArgument(char * buffer, size_t bufferSize, char arg) { const char * functionName = fullName(); int index = 0; diff --git a/apps/shared/storage_function.h b/apps/shared/storage_function.h index d5b94c2f1..aaaf0d535 100644 --- a/apps/shared/storage_function.h +++ b/apps/shared/storage_function.h @@ -20,7 +20,6 @@ public: bool isActive() const; KDColor color() const; void setActive(bool active); - void setColor(KDColor color); // Name int nameWithArgument(char * buffer, size_t bufferSize, char arg); @@ -36,9 +35,8 @@ public: protected: class FunctionRecordData { public: - FunctionRecordData() : m_color(KDColorRed), m_active(true) {} + FunctionRecordData(KDColor color) : m_color(color), m_active(true) {} KDColor color() const { return m_color; } - void setColor(KDColor color) { m_color = color; } bool isActive() const { return m_active; } void setActive(bool active) { m_active = active; } private: diff --git a/escher/include/escher/palette.h b/escher/include/escher/palette.h index c78c6aea9..c32254638 100644 --- a/escher/include/escher/palette.h +++ b/escher/include/escher/palette.h @@ -30,7 +30,7 @@ public: constexpr static KDColor Orange = KDColor::RGB24(0xfe871f); constexpr static KDColor Green = KDColor::RGB24(0x50c102); constexpr static KDColor GreenLight = KDColor::RGB24(0x52db8f); - constexpr static KDColor DataColor[] = {Red, Blue, Green, YellowDark}; + constexpr static KDColor DataColor[] = {Red, Blue, Green, YellowDark, Magenta, Turquoise, Pink, Orange}; constexpr static KDColor DataColorLight[] = {RedLight, BlueLight, GreenLight, YellowLight}; };