Base: Move App::Color to Base

Every basic data type is stored in Base module, color is standing out as
one that does not. Moving it to Base opens possibilities to integrate it
better with the rest of FreeCAD.
This commit is contained in:
Kacper Donat
2025-02-15 22:58:19 +01:00
parent 145af5cddc
commit a72a63232a
215 changed files with 1057 additions and 1054 deletions

View File

@@ -105,7 +105,7 @@ const char* SoFCColorGradient::getColorBarName() const
void SoFCColorGradient::applyFormat(const SoLabelTextFormat& fmt)
{
auto textColor = App::Color(fmt.textColor);
auto textColor = Base::Color(fmt.textColor);
for (int j = 0; j < labels->getNumChildren(); j++) {
if (labels->getChild(j)->getTypeId() == SoBaseColor::getClassTypeId()) {
@@ -131,7 +131,7 @@ void SoFCColorGradient::setMarkerLabel(const SoMFString& label)
auto trans = new SoTransform;
SoLabelTextFormat fmt = getFormat();
auto textColor = App::Color(fmt.textColor);
auto textColor = Base::Color(fmt.textColor);
auto textFont = new SoFont;
auto color = new SoBaseColor;
textFont->name.setValue("Helvetica,Arial,Times New Roman");
@@ -356,7 +356,7 @@ SoMaterial* SoFCColorGradient::createMaterial() const
auto mat = new SoMaterial;
mat->diffuseColor.setNum(2 * numColors);
for (int k = 0; k < numColors; k++) {
App::Color col = model.colors[numColors - k - 1];
Base::Color col = model.colors[numColors - k - 1];
mat->diffuseColor.set1Value(2 * k, col.r, col.g, col.b);
mat->diffuseColor.set1Value(2 * k + 1, col.r, col.g, col.b);
}