mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
will make equal colors more seldom in a project. And use a bit less "hard" colors first.
This commit is contained in:
parent
27271c7988
commit
f7ebf80e0d
@ -95,7 +95,7 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
|
||||
RigWellLogFile* wellLogDataFile = wellLogFile->wellLogFile();
|
||||
CVF_ASSERT(wellLogDataFile);
|
||||
|
||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromIndex(curveIdx);
|
||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable();
|
||||
curve->setColor(curveColor);
|
||||
curve->setWellPath(wellPath);
|
||||
curve->setWellLogChannelName(wellLog->name());
|
||||
|
@ -123,7 +123,7 @@ RimWellLogExtractionCurve* RicNewWellLogCurveExtractionFeature::addCurve(RimWell
|
||||
|
||||
RimWellLogExtractionCurve* curve = new RimWellLogExtractionCurve();
|
||||
|
||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromIndex(curveIndex);
|
||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable();
|
||||
curve->setColor(curveColor);
|
||||
curve->setWellPath(wellPath);
|
||||
curve->setPropertiesFromView(view);
|
||||
|
@ -149,7 +149,7 @@ RimWellLogFileCurve* RicNewWellLogFileCurveFeature::addCurve(RimWellLogPlotTrack
|
||||
RimWellLogFileCurve* curve = new RimWellLogFileCurve();
|
||||
plotTrack->addCurve(curve);
|
||||
|
||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromIndex(curveIndex);
|
||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable();
|
||||
curve->setColor(curveColor);
|
||||
|
||||
plotTrack->updateConnectedEditors();
|
||||
|
@ -24,13 +24,7 @@
|
||||
static const int RI_LOGPLOT_CURVECOLORSCOUNT = 15;
|
||||
static const int RI_LOGPLOT_CURVECOLORS[] =
|
||||
{
|
||||
Qt::blue,
|
||||
Qt::red,
|
||||
Qt::green,
|
||||
Qt::yellow,
|
||||
Qt::magenta,
|
||||
Qt::cyan,
|
||||
Qt::gray,
|
||||
Qt::black,
|
||||
Qt::darkBlue,
|
||||
Qt::darkRed,
|
||||
Qt::darkGreen,
|
||||
@ -38,16 +32,23 @@ static const int RI_LOGPLOT_CURVECOLORS[] =
|
||||
Qt::darkMagenta,
|
||||
Qt::darkCyan,
|
||||
Qt::darkGray,
|
||||
Qt::black
|
||||
Qt::blue,
|
||||
Qt::red,
|
||||
Qt::green,
|
||||
Qt::yellow,
|
||||
Qt::magenta,
|
||||
Qt::cyan,
|
||||
Qt::gray
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Pick default curve color from an index based palette
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RicWellLogPlotCurveFeatureImpl::curveColorFromIndex(size_t curveIndex)
|
||||
cvf::Color3f RicWellLogPlotCurveFeatureImpl::curveColorFromTable()
|
||||
{
|
||||
QColor color = QColor(Qt::GlobalColor(RI_LOGPLOT_CURVECOLORS[curveIndex % RI_LOGPLOT_CURVECOLORSCOUNT]));
|
||||
|
||||
static int colorIndex = 0;
|
||||
QColor color = QColor(Qt::GlobalColor(RI_LOGPLOT_CURVECOLORS[colorIndex % RI_LOGPLOT_CURVECOLORSCOUNT]));
|
||||
++colorIndex;
|
||||
cvf::Color3f cvfColor(color.redF(), color.greenF(), color.blueF());
|
||||
return cvfColor;
|
||||
}
|
||||
|
@ -28,5 +28,5 @@ class RicWellLogPlotCurveFeatureImpl
|
||||
{
|
||||
|
||||
public:
|
||||
static cvf::Color3f curveColorFromIndex(size_t curveIndex);
|
||||
static cvf::Color3f curveColorFromTable();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user