This isn't so hard to locate, as we can just search for the entire string in the source code.
This is the result, src/Mod/Sketcher/Gui/ViewProviderSketch.cpp, lines 5837 to 5894.
It seems the colors are hard coded in the strings for "Over-constrained sketch", "Sketch contains conflicting constraints ", "Sketch contains redundant constraints", "Fully constrained sketch", "Under-constrained sketch with %1 degrees of freedom", "Solved in %1 sec", and "Unsolved in %1 sec".
Code: Select all
void ViewProviderSketch::UpdateSolverInformation()
{
// Updates Solver Information with the Last solver execution at SketchObject level
int dofs = getSketchObject()->getLastDoF();
bool hasConflicts = getSketchObject()->getLastHasConflicts();
bool hasRedundancies = getSketchObject()->getLastHasRedundancies();
if (getSketchObject()->Geometry.getSize() == 0) {
signalSetUp(tr("Empty sketch"));
signalSolved(QString());
}
else if (dofs < 0) { // over-constrained sketch
std::string msg;
SketchObject::appendConflictMsg(getSketchObject()->getLastConflicting(), msg);
signalSetUp(QString::fromLatin1("<font color='red'>%1<a href=\"#conflicting\"><span style=\" text-decoration: underline; color:#0000ff;\">%2</span></a><br/>%3</font><br/>")
.arg(tr("Over-constrained sketch "))
.arg(tr("(click to select)"))
.arg(QString::fromStdString(msg)));
signalSolved(QString());
}
else if (hasConflicts) { // conflicting constraints
signalSetUp(QString::fromLatin1("<font color='red'>%1<a href=\"#conflicting\"><span style=\" text-decoration: underline; color:#0000ff;\">%2</span></a><br/>%3</font><br/>")
.arg(tr("Sketch contains conflicting constraints "))
.arg(tr("(click to select)"))
.arg(appendConflictMsg(getSketchObject()->getLastConflicting())));
signalSolved(QString());
}
else {
if (hasRedundancies) { // redundant constraints
signalSetUp(QString::fromLatin1("<font color='orangered'>%1<a href=\"#redundant\"><span style=\" text-decoration: underline; color:#0000ff;\">%2</span></a><br/>%3</font><br/>")
.arg(tr("Sketch contains redundant constraints "))
.arg(tr("(click to select)"))
.arg(appendRedundantMsg(getSketchObject()->getLastRedundant())));
}
if (getSketchObject()->getLastSolverStatus() == 0) {
if (dofs == 0) {
// color the sketch as fully constrained if it has geometry (other than the axes)
if(getSketchObject()->getSolvedSketch().getGeometrySize()>2)
edit->FullyConstrained = true;
if (!hasRedundancies) {
signalSetUp(QString::fromLatin1("<font color='green'>%1</font>").arg(tr("Fully constrained sketch")));
}
}
else if (!hasRedundancies) {
if (dofs == 1)
signalSetUp(tr("Under-constrained sketch with <a href=\"#dofs\"><span style=\" text-decoration: underline; color:#0000ff;\">1 degree</span></a> of freedom"));
else
signalSetUp(tr("Under-constrained sketch with <a href=\"#dofs\"><span style=\" text-decoration: underline; color:#0000ff;\">%1 degrees</span></a> of freedom").arg(dofs));
}
signalSolved(QString::fromLatin1("<font color='green'>%1</font>").arg(tr("Solved in %1 sec").arg(getSketchObject()->getLastSolveTime())));
}
else {
signalSolved(QString::fromLatin1("<font color='red'>%1</font>").arg(tr("Unsolved (%1 sec)").arg(getSketchObject()->getLastSolveTime())));
}
}
}
Code: Select all
<font color='red'>%1</font>
Code: Select all
<span style=\" text-decoration: underline; color:#0000ff;\">%1 degrees</span>
Then maybe we can test the code with
Code: Select all
<font color=overconstrained_color>%1</font>
<span style=\" underconstrained_style;\">%1 degrees</span>