Color theme tweaks and fixes

This commit is contained in:
Charles J. Cliffe 2015-01-15 20:37:51 -05:00
parent 15347bd791
commit c04779e91b
6 changed files with 161 additions and 95 deletions

View File

@ -61,6 +61,34 @@ DefaultColorTheme::DefaultColorTheme() {
generalBackground = RGBColor(0.1, 0.1, 0.1);
}
RadarColorTheme::RadarColorTheme() {
name = "Rad";
waterfallGradient.addColor(GradientColor(5.0 / 255.0, 45.0 / 255.0, 10.0 / 255.0));
waterfallGradient.addColor(GradientColor(30.0 / 255.0, 150.0 / 255.0, 40.0 / 255.0));
waterfallGradient.addColor(GradientColor(40.0 / 255.0, 240.0 / 255.0, 60.0 / 255.0));
waterfallGradient.addColor(GradientColor(250.0 / 255.0, 250.0 / 255.0, 250.0 / 255.0));
waterfallGradient.generate(256);
waterfallHighlight = RGBColor(1, 1, 1);
waterfallNew = RGBColor(0, 1, 0);
waterfallHover = RGBColor(1, 1, 0);
waterfallDestroy = RGBColor(1, 0, 0);
fftLine = RGBColor(0.8, 1.0, 0.8);
fftHighlight = RGBColor(1, 1, 1);
scopeLine = RGBColor(0.8, 1.0, 0.8);
tuningBar = RGBColor(0.2, 0.9, 0.2);
meterLevel = RGBColor(0, 0.5, 0);
meterValue = RGBColor(0, 0.5, 0);
text = RGBColor(0.8, 1.0, 0.8);
freqLine = RGBColor(1, 1, 1);
button = RGBColor(0.65, 0.75, 0.65);
buttonHighlight = RGBColor(0.65, 1.0, 0.65);
scopeBackground = RGBColor(0.05, 0.1, 0.05);
fftBackground = RGBColor(0.05, 0.1, 0.05);
generalBackground = RGBColor(0.05, 0.1, 0.05);
}
BlackAndWhiteColorTheme::BlackAndWhiteColorTheme() {
name = "Black & White";
waterfallGradient.addColor(GradientColor(0, 0, 0));
@ -108,12 +136,12 @@ SharpColorTheme::SharpColorTheme() {
waterfallDestroy = RGBColor(1, 0, 0);
fftLine = RGBColor(0.9, 0.9, 1.0);
fftHighlight = RGBColor(0.9, 0.9, 1.0);
scopeLine = RGBColor(0.9, 0.9, 1.0);
scopeLine = RGBColor(0.85, 0.85, 1.0);
tuningBar = RGBColor(0.2, 0.2, 0.9);
meterLevel = RGBColor(28.0 / 255.0, 106.0 / 255.0, 179.0 / 255.0);
meterValue = RGBColor(190.0 / 255.0, 190.0 / 255.0, 60.0 / 255.0);
text = RGBColor(0.9, 0.9, 1);
freqLine = RGBColor(0.9, 0.9, 1);
freqLine = RGBColor(0.85, 0.85, 1.0);
button = RGBColor(217.0 / 255.0, 218.0 / 255.0, 228.0 / 255.0);
buttonHighlight = RGBColor(208.0 / 255.0, 249.0 / 255.0, 255.0 / 255.0);
@ -134,23 +162,27 @@ RadColorTheme::RadColorTheme() {
waterfallNew = RGBColor(0, 1, 0);
waterfallHover = RGBColor(1, 1, 0);
waterfallDestroy = RGBColor(1, 0, 0);
fftLine = RGBColor(0.9, 0.9, 0.9);
fftLine = RGBColor(1.0, 0.9, 0.9);
fftHighlight = RGBColor(1, 1, 1);
scopeLine = RGBColor(0.9, 0.9, 0.9);
scopeLine = RGBColor(1.0, 0.9, 0.9);
tuningBar = RGBColor(0.2, 0.2, 0.9);
meterLevel = RGBColor(0, 1, 0);
meterValue = RGBColor(1, 0, 0);
meterLevel = RGBColor(0, 0.5, 0);
meterValue = RGBColor(0.5, 0, 0);
text = RGBColor(1, 1, 1);
freqLine = RGBColor(1, 1, 1);
button = RGBColor(0.65, 0.65, 0.65);
buttonHighlight = RGBColor(1, 1, 0);
buttonHighlight = RGBColor(0.76, 0.65, 0);
scopeBackground = RGBColor(13.0 / 255.0, 47.0 / 255.0, 9.0 / 255.0);
fftBackground = RGBColor(0, 0, 50.0 / 255.0);
generalBackground = RGBColor(13.0 / 255.0, 47.0 / 255.0, 9.0 / 255.0);
}
TouchColorTheme::TouchColorTheme() {
name = "Touch";
waterfallGradient.addColor(GradientColor(0, 0, 0));
waterfallGradient.addColor(GradientColor(55.0 / 255.0, 40.0 / 255.0, 55.0 / 255.0));
waterfallGradient.addColor(GradientColor(60.0 / 255.0, 60.0 / 255.0, 90.0 / 255.0));
waterfallGradient.addColor(GradientColor(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0));
waterfallGradient.addColor(GradientColor(0.0 / 255.0, 255.0 / 255.0, 255.0 / 255.0));
waterfallGradient.addColor(GradientColor(10.0 / 255.0, 255.0 / 255.0, 85.0 / 255.0));
waterfallGradient.addColor(GradientColor(255.0 / 255.0, 255.0 / 255.0, 75.0 / 255.0));
@ -161,16 +193,21 @@ TouchColorTheme::TouchColorTheme() {
waterfallNew = RGBColor(0, 1, 0);
waterfallHover = RGBColor(1, 1, 0);
waterfallDestroy = RGBColor(1, 0, 0);
fftLine = RGBColor(0.9, 0.9, 0.9);
fftHighlight = RGBColor(1, 1, 1);
scopeLine = RGBColor(0.9, 0.9, 0.9);
tuningBar = RGBColor(0.2, 0.2, 0.9);
meterLevel = RGBColor(0, 1, 0);
meterValue = RGBColor(1, 0, 0);
fftLine = RGBColor(234.0 / 255.0, 232.0 / 255.0, 247.0 / 255.0);
fftHighlight = RGBColor(1.0, 1.0, 1.0);
scopeLine = RGBColor(234.0 / 255.0, 232.0 / 255.0, 247.0 / 255.0);
tuningBar = RGBColor(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
meterLevel = RGBColor(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
meterValue = RGBColor(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
text = RGBColor(1, 1, 1);
freqLine = RGBColor(1, 1, 1);
button = RGBColor(0.65, 0.65, 0.65);
buttonHighlight = RGBColor(1, 1, 0);
button = RGBColor(1.0, 1.0, 1.0);
buttonHighlight = RGBColor(208.0 / 255.0, 202.0 / 255.0, 247.0 / 255.0);
scopeBackground = RGBColor(39.0 / 255.0, 36.0 / 255.0, 56.0 / 255.0);
fftBackground = RGBColor(39.0 / 255.0, 36.0 / 255.0, 56.0 / 255.0);
generalBackground = RGBColor(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0);
}
HDColorTheme::HDColorTheme() {
@ -191,39 +228,17 @@ HDColorTheme::HDColorTheme() {
fftLine = RGBColor(0.9, 0.9, 0.9);
fftHighlight = RGBColor(1, 1, 1);
scopeLine = RGBColor(0.9, 0.9, 0.9);
tuningBar = RGBColor(0.2, 0.2, 0.9);
meterLevel = RGBColor(0, 1, 0);
meterValue = RGBColor(1, 0, 0);
tuningBar = RGBColor(0, 0.7, 0.7);
meterLevel = RGBColor(0, 0.5, 0);
meterValue = RGBColor(0.0, 0.0, 1.0);
text = RGBColor(1, 1, 1);
freqLine = RGBColor(1, 1, 1);
button = RGBColor(0.65, 0.65, 0.65);
buttonHighlight = RGBColor(1, 1, 0);
}
RadarColorTheme::RadarColorTheme() {
name = "Rad";
waterfallGradient.addColor(GradientColor(5.0 / 255.0, 45.0 / 255.0, 10.0 / 255.0));
waterfallGradient.addColor(GradientColor(30.0 / 255.0, 150.0 / 255.0, 40.0 / 255.0));
waterfallGradient.addColor(GradientColor(40.0 / 255.0, 240.0 / 255.0, 60.0 / 255.0));
waterfallGradient.addColor(GradientColor(250.0 / 255.0, 250.0 / 255.0, 250.0 / 255.0));
waterfallGradient.generate(256);
waterfallHighlight = RGBColor(1, 1, 1);
waterfallNew = RGBColor(0, 1, 0);
waterfallHover = RGBColor(1, 1, 0);
waterfallDestroy = RGBColor(1, 0, 0);
fftLine = RGBColor(0.8, 1.0, 0.8);
fftHighlight = RGBColor(1, 1, 1);
scopeLine = RGBColor(0.8, 1.0, 0.8);
tuningBar = RGBColor(0.2, 0.9, 0.2);
meterLevel = RGBColor(0, 0.5, 0);
meterValue = RGBColor(0, 0.5, 0);
text = RGBColor(0.8, 1.0, 0.8);
freqLine = RGBColor(1, 1, 1);
button = RGBColor(0.65, 0.75, 0.65);
buttonHighlight = RGBColor(0.65, 1.0, 0.65);
scopeBackground = RGBColor(0.05, 0.1, 0.05);
fftBackground = RGBColor(0.05, 0.1, 0.05);
generalBackground = RGBColor(0.05, 0.1, 0.05);
button = RGBColor(0, 0.7, 0.7);
buttonHighlight = RGBColor(1, 1, 1);
scopeBackground = RGBColor(0.0, 0.0, 48.0 / 255.0);
fftBackground = RGBColor(0.0, 0.0, 48.0 / 255.0);
generalBackground = RGBColor(0.0, 0.0, 0.0);
}

View File

@ -53,7 +53,7 @@ void ModeSelectorContext::DrawSelector(std::string label, int c, int cMax, bool
glEnd();
if (on) {
glColor4f(1.0-r, 1.0-g, 1.0-b, a);
glColor4f(0, 0, 0, a);
}
getFont(fontSize).drawString(label, 0.0, y + height / 2.0, fontHeight, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER);

View File

@ -116,7 +116,7 @@ void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, float r, float
glDisable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_DST_COLOR);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(r, g, b, 0.6);
float ofs = ((float) demod->getBandwidth()) / (float) srate;

View File

@ -13,7 +13,8 @@ ScopeContext::ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext) :
}
void ScopeContext::DrawBegin() {
glClearColor(ThemeMgr::mgr.currentTheme->scopeBackground.r, ThemeMgr::mgr.currentTheme->scopeBackground.g, ThemeMgr::mgr.currentTheme->scopeBackground.b, 1.0);
glClearColor(ThemeMgr::mgr.currentTheme->scopeBackground.r, ThemeMgr::mgr.currentTheme->scopeBackground.g,
ThemeMgr::mgr.currentTheme->scopeBackground.b, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode (GL_MODELVIEW);
@ -23,49 +24,86 @@ void ScopeContext::DrawBegin() {
}
void ScopeContext::Plot(std::vector<float> &points, bool stereo) {
if (stereo) {
glBegin(GL_QUADS);
glColor3f(ThemeMgr::mgr.currentTheme->scopeBackground.r*2.0, ThemeMgr::mgr.currentTheme->scopeBackground.g*2.0, ThemeMgr::mgr.currentTheme->scopeBackground.b*2.0);
glColor3f(ThemeMgr::mgr.currentTheme->scopeBackground.r, ThemeMgr::mgr.currentTheme->scopeBackground.g, ThemeMgr::mgr.currentTheme->scopeBackground.b);
glVertex2f(1, 1);
glVertex2f(-1, 1);
glColor3f(ThemeMgr::mgr.currentTheme->scopeBackground.r*2.0, ThemeMgr::mgr.currentTheme->scopeBackground.g*2.0, ThemeMgr::mgr.currentTheme->scopeBackground.b*2.0);
glVertex2f(-1, 0.5);
glVertex2f(1, 0.5);
glVertex2f(-1, 0.5);
glVertex2f(1, 0.5);
glColor3f(ThemeMgr::mgr.currentTheme->scopeBackground.r, ThemeMgr::mgr.currentTheme->scopeBackground.g, ThemeMgr::mgr.currentTheme->scopeBackground.b);
glVertex2f(1, 0.0);
glVertex2f(-1, 0.0);
glColor3f(ThemeMgr::mgr.currentTheme->scopeBackground.r, ThemeMgr::mgr.currentTheme->scopeBackground.g, ThemeMgr::mgr.currentTheme->scopeBackground.b);
glVertex2f(1, 0);
glVertex2f(-1, 0);
glColor3f(ThemeMgr::mgr.currentTheme->scopeBackground.r*2.0, ThemeMgr::mgr.currentTheme->scopeBackground.g*2.0, ThemeMgr::mgr.currentTheme->scopeBackground.b*2.0);
glVertex2f(-1, -0.5);
glVertex2f(1, -0.5);
glVertex2f(-1, -0.5);
glVertex2f(1, -0.5);
glColor3f(ThemeMgr::mgr.currentTheme->scopeBackground.r, ThemeMgr::mgr.currentTheme->scopeBackground.g, ThemeMgr::mgr.currentTheme->scopeBackground.b);
glVertex2f(1, -1.0);
glVertex2f(-1, -1.0);
glEnd();
} else {
glBegin (GL_QUADS);
glColor3f(ThemeMgr::mgr.currentTheme->scopeBackground.r, ThemeMgr::mgr.currentTheme->scopeBackground.g,
ThemeMgr::mgr.currentTheme->scopeBackground.b);
glVertex2f(1, 1);
glVertex2f(-1, 1);
glColor3f(ThemeMgr::mgr.currentTheme->scopeBackground.r * 2.0, ThemeMgr::mgr.currentTheme->scopeBackground.g * 2.0,
ThemeMgr::mgr.currentTheme->scopeBackground.b * 2.0);
glVertex2f(-1, 0);
glVertex2f(1, 0);
glVertex2f(-1, 0);
glVertex2f(1, 0);
glColor3f(ThemeMgr::mgr.currentTheme->scopeBackground.r*2.0, ThemeMgr::mgr.currentTheme->scopeBackground.g*2.0, ThemeMgr::mgr.currentTheme->scopeBackground.b*2.0);
glColor3f(ThemeMgr::mgr.currentTheme->scopeBackground.r, ThemeMgr::mgr.currentTheme->scopeBackground.g,
ThemeMgr::mgr.currentTheme->scopeBackground.b);
glVertex2f(1, -1);
glVertex2f(-1, -1);
glEnd();
glColor3f(1.0, 1.0, 1.0);
}
glLineWidth(1.0);
if (stereo) {
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r, ThemeMgr::mgr.currentTheme->scopeLine.g, ThemeMgr::mgr.currentTheme->scopeLine.b);
glBegin (GL_LINES);
glVertex2f(-1.0, 0.0);
glVertex2f(1.0, 0.0);
glEnd();
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r*0.35, ThemeMgr::mgr.currentTheme->scopeLine.g*0.35, ThemeMgr::mgr.currentTheme->scopeLine.b*0.35);
glBegin(GL_LINES);
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r * 0.35, ThemeMgr::mgr.currentTheme->scopeLine.g * 0.35,
ThemeMgr::mgr.currentTheme->scopeLine.b * 0.35);
glVertex2f(-1.0, 0.5);
glVertex2f(1.0, 0.5);
glVertex2f(-1.0, -0.5);
glVertex2f(1.0, -0.5);
glEnd();
} else {
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r*0.35, ThemeMgr::mgr.currentTheme->scopeLine.g*0.35, ThemeMgr::mgr.currentTheme->scopeLine.b*0.35);
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r * 0.35, ThemeMgr::mgr.currentTheme->scopeLine.g * 0.35,
ThemeMgr::mgr.currentTheme->scopeLine.b * 0.35);
glBegin (GL_LINES);
glVertex2f(-1.0, 0.0);
glVertex2f(1.0, 0.0);
glEnd();
}
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r, ThemeMgr::mgr.currentTheme->scopeLine.g, ThemeMgr::mgr.currentTheme->scopeLine.b);
if (points.size()) {
glEnable (GL_BLEND);
glEnable (GL_LINE_SMOOTH);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(ThemeMgr::mgr.currentTheme->scopeLine.r, ThemeMgr::mgr.currentTheme->scopeLine.g, ThemeMgr::mgr.currentTheme->scopeLine.b, 1.0);
glEnableClientState (GL_VERTEX_ARRAY);
glVertexPointer(2, GL_FLOAT, 0, &points[0]);
if (stereo) {
glLineWidth(1.5);
glPushMatrix();
glTranslatef(-1.0f, 0.5f, 0.0f);
glScalef(4.0f, 0.92f, 1.0f);
@ -80,14 +118,16 @@ void ScopeContext::Plot(std::vector<float> &points, bool stereo) {
glPopMatrix();
glPopMatrix();
} else {
glLineWidth(1.5);
glPushMatrix();
glTranslatef(-1.0f, 0.0f, 0.0f);
glScalef(2.0f, 2.0f, 1.0f);
glDrawArrays(GL_LINE_STRIP, 0, points.size() / 2);
glPopMatrix();
}
glLineWidth(1.0);
glDisableClientState(GL_VERTEX_ARRAY);
glDisable(GL_BLEND);
}
}

View File

@ -19,18 +19,22 @@ SpectrumContext::SpectrumContext(SpectrumCanvas *canvas, wxGLContext *sharedCont
void SpectrumContext::Draw(std::vector<float> &points, long long freq, int bandwidth) {
glBegin(GL_QUADS);
glColor3f(ThemeMgr::mgr.currentTheme->fftBackground.r*2.0, ThemeMgr::mgr.currentTheme->fftBackground.g*2.0, ThemeMgr::mgr.currentTheme->fftBackground.b*2.0);
glVertex2f(1, 1);
glVertex2f(-1, 1);
glColor3f(ThemeMgr::mgr.currentTheme->fftBackground.r, ThemeMgr::mgr.currentTheme->fftBackground.g, ThemeMgr::mgr.currentTheme->fftBackground.b);
glVertex2f(-1, -0.5);
glVertex2f(1, -0.5);
glVertex2f(1, 0.5);
glVertex2f(-1, 0.5);
glColor3f(ThemeMgr::mgr.currentTheme->fftBackground.r*2.0, ThemeMgr::mgr.currentTheme->fftBackground.g*2.0, ThemeMgr::mgr.currentTheme->fftBackground.b*2.0);
glVertex2f(-1, -1);
glVertex2f(1, -1);
glEnd();
glDisable(GL_TEXTURE_2D);
glColor3f(ThemeMgr::mgr.currentTheme->fftLine.r, ThemeMgr::mgr.currentTheme->fftLine.g, ThemeMgr::mgr.currentTheme->fftLine.b);
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
if (points.size()) {
glPushMatrix();
glTranslatef(-1.0f, -0.75f, 0.0f);

View File

@ -40,10 +40,17 @@ void TuningContext::DrawBegin() {
void TuningContext::Draw(float r, float g, float b, float a, float p1, float p2) {
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
glColor4f(r, g, b, a);
glBegin(GL_QUADS);
glColor4f(r*0.5, g*0.5, b*0.5, a);
glVertex2f(-1.0+p2*2.0, 1.0);
glVertex2f(-1.0+p1*2.0, 1.0);
glColor4f(r, g, b, a);
glVertex2f(-1.0+p1*2.0, 0.0);
glVertex2f(-1.0+p2*2.0, 0.0);
glVertex2f(-1.0+p2*2.0, 0.0);
glVertex2f(-1.0+p1*2.0, 0.0);
glColor4f(r*0.5, g*0.5, b*0.5, a);
glVertex2f(-1.0+p1*2.0, -1.0);
glVertex2f(-1.0+p2*2.0, -1.0);
glEnd();