1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Reverse meanings of "Grayscale" and "Inverse Grayscale" ...

... The first, not the second, will correspond to the old Grayscale.  This
shows higher energy as darker.  That is how monochrome spectrograms have
usually been inked onto paper.
This commit is contained in:
Paul Licameli 2021-06-24 13:51:10 -04:00 committed by Dmitry Vedenko
parent 70bb6a63c3
commit 1f9a81eb82
2 changed files with 9 additions and 9 deletions

View File

@ -714,7 +714,7 @@ void AColor::PreComputeGradient() {
gradient_pre[selected][1][i][2] = (unsigned char) (255 * b);
}
// colorScheme 2: Grayscale
// colorScheme 3: Inverse Grayscale
for (int i = 0; i < gradientSteps; i++) {
float r, g, b;
float value = float(i) / gradientSteps;
@ -743,12 +743,12 @@ void AColor::PreComputeGradient() {
b = 1.0f;
break;
}
gradient_pre[selected][2][i][0] = (unsigned char)(255 * r);
gradient_pre[selected][2][i][1] = (unsigned char)(255 * g);
gradient_pre[selected][2][i][2] = (unsigned char)(255 * b);
gradient_pre[selected][3][i][0] = (unsigned char)(255 * r);
gradient_pre[selected][3][i][1] = (unsigned char)(255 * g);
gradient_pre[selected][3][i][2] = (unsigned char)(255 * b);
}
// colorScheme 3: Inv. Grayscale (=Old grayscale)
// colorScheme 2: Grayscale (=Old grayscale)
for (int i = 0; i<gradientSteps; i++) {
float r, g, b;
float value = float(i)/gradientSteps;
@ -781,9 +781,9 @@ void AColor::PreComputeGradient() {
b = 1.0f;
break;
}
gradient_pre[selected][3][i][0] = (unsigned char) (255 * r);
gradient_pre[selected][3][i][1] = (unsigned char) (255 * g);
gradient_pre[selected][3][i][2] = (unsigned char) (255 * b);
gradient_pre[selected][2][i][0] = (unsigned char) (255 * r);
gradient_pre[selected][2][i][1] = (unsigned char) (255 * g);
gradient_pre[selected][2][i][2] = (unsigned char) (255 * b);
}
}
}

View File

@ -182,7 +182,7 @@ void SpectrogramSettings::ColorSchemeEnumSetting::Migrate(wxString &value)
// Migrate old grayscale option to Color scheme choice
bool isGrayscale = (gPrefs->Read(wxT("/Spectrum/Grayscale"), 0L) != 0);
if (isGrayscale && !gPrefs->Read(wxT("/Spectrum/ColorScheme"), &value)) {
value = GetColorSchemeNames().at(csInvGrayscale).Internal();
value = GetColorSchemeNames().at(csGrayscale).Internal();
Write(value);
gPrefs->Flush();
}