Browse Source

Tweak themes for more color consistency.

tags/v1.3.1001
Jonathan Moore Liles 4 years ago
parent
commit
26989fbfd6
5 changed files with 47 additions and 13 deletions
  1. +7
    -4
      src/Cairo_Theme.cxx
  2. +4
    -1
      src/Clean_Theme.cxx
  3. +4
    -1
      src/Crystal_Theme.cxx
  4. +4
    -1
      src/Gleam_Theme.cxx
  5. +28
    -6
      src/Vector_Theme.cxx

+ 7
- 4
src/Cairo_Theme.cxx View File

@@ -28,7 +28,7 @@
#include "FL/Fl_Theme.H"
#include <math.h>

float fl_box_saturation = 0.2f;
float fl_box_saturation = 0.8f;
bool fl_boxes_use_gradients = true;
bool fl_debug_boxes = false;

@@ -152,7 +152,7 @@ static void shade_rect_down(int x, int y, int w, int h, Fl_Color bc)

static void up_frame(int x, int y, int w, int h, Fl_Color c)
{
frame_rect_up(x, y, w, h, fl_darker(c));
frame_rect_up(x, y, w, h, c);
}

static void thin_up_box(int x, int y, int w, int h, Fl_Color c)
@@ -172,12 +172,15 @@ static void down_frame(int x, int y, int w, int h, Fl_Color c)

static void down_box(int x, int y, int w, int h, Fl_Color c)
{
shade_rect_down(x, y, w, h, fl_lighter(c));
shade_rect_down(x, y, w, h, c == FL_BACKGROUND_COLOR || c == FL_BACKGROUND2_COLOR ? fl_darker(c) : c );
}

static void thin_down_box(int x, int y, int w, int h, Fl_Color c)
{
down_box(x, y, w, h, fl_lighter(c));
down_box(x, y, w, h,
FL_BACKGROUND_COLOR == c || FL_BACKGROUND2_COLOR == c
? fl_darker(c)
: c );
}

static void border_box(int x, int y, int w, int h, Fl_Color c)


+ 4
- 1
src/Clean_Theme.cxx View File

@@ -64,7 +64,10 @@ static void down_frame(int x, int y, int w, int h, Fl_Color c)

static void down_box(int x, int y, int w, int h, Fl_Color c)
{
rectf(x, y, w, h, c );
rectf(x, y, w, h,
FL_BACKGROUND_COLOR == c || FL_BACKGROUND2_COLOR == c
? fl_darker(c)
: c );
rect(x, y, w, h, fl_color_average( FL_WHITE, c, 0.2 ) );
}



+ 4
- 1
src/Crystal_Theme.cxx View File

@@ -352,7 +352,10 @@ down_box ( int x, int y, int w, int h, Fl_Color c )
if ( w > 6 && h > 6 )
{
// shade_rect( x + 2, y + 2, w - 4, h - 5, "STUVWWWVT", c );
fl_rectf( x + 2, y + 2, w - 4, h - 5 , fl_darker( c ) );
fl_rectf( x + 2, y + 2, w - 4, h - 5 ,
FL_BACKGROUND_COLOR == c || FL_BACKGROUND2_COLOR == c
? fl_darker(c)
: c );
down_frame( x, y, w, h, c );
}
else


+ 4
- 1
src/Gleam_Theme.cxx View File

@@ -140,7 +140,10 @@ static void down_frame(int x, int y, int w, int h, Fl_Color c)

static void down_box(int x, int y, int w, int h, Fl_Color c)
{
shade_rect_down(x + 1, y, w - 2, h, c);
shade_rect_down(x + 1, y, w - 2, h,
FL_BACKGROUND_COLOR == c || FL_BACKGROUND2_COLOR == c
? fl_darker(c)
: c );
down_frame(x, y, w, h, fl_darker(c));
//draw the inner rect.
//frame_rect(x + 1, y + 1, w - 3, h - 3, fl_color_average(c, FL_BLACK, .65));


+ 28
- 6
src/Vector_Theme.cxx View File

@@ -48,11 +48,19 @@ static void cairo_color(Fl_Color c)
static Fl_Color border_color ( Fl_Color c )
{
return fl_color_average( FL_FOREGROUND_COLOR, c, 0.20f );
/* return fl_color_average( FL_FOREGROUND_COLOR, c, 0.33f ); */
/* return fl_color_average( FL_FOREGROUND_COLOR, c, 0.50f ); */
}

static Fl_Color interior_color ( Fl_Color c )
{
return fl_color_average( FL_BACKGROUND_COLOR, c, 0.50f );
return fl_color_average( FL_BACKGROUND_COLOR, c, 0.33f );
}

static Fl_Color outer_border_color ( Fl_Color c )
{
/* return fl_darker( interior_color( c ) ); */
return fl_color_average( c, FL_BACKGROUND_COLOR, 0.50f );
}

static void rect_path ( float x, float y, float w, float h, double radius )
@@ -96,23 +104,34 @@ static void draw_rectf(int x, int y, int w, int h, Fl_Color bc, double radius =
static void up_box(int x, int y, int w, int h, Fl_Color bc)
{
draw_rectf( x, y, w, h, interior_color( bc ) );
draw_rect( x, y, w, h, border_color( bc ) );
/* draw_rect( x, y, w, h, border_color( bc ) ); */
draw_rect( x+1, y+1, w-2, h-2, border_color( bc ) );
draw_rect( x, y, w, h, outer_border_color( bc ) );
}

static void up_frame(int x, int y, int w, int h, Fl_Color bc)
{
draw_rect( x,y,w,h, border_color(bc) );
/* draw_rect( x, y, w, h, border_color( bc ) ); */
draw_rect( x+1,y+1,w-2,h-2, border_color(bc) );
draw_rect( x, y, w, h, outer_border_color( bc ) );
}

static void down_frame(int x, int y, int w, int h, Fl_Color bc)
{
draw_rect( x,y,w,h, bc );
/* draw_rect( x, y, w, h, bc ); */
draw_rect( x+1,y+1,w-2,h-2, bc );
draw_rect( x, y, w, h, outer_border_color( bc ) );
}

static void down_box(int x, int y, int w, int h, Fl_Color bc)
{
draw_rectf( x, y, w, h, interior_color( bc ) );
draw_rect( x, y, w, h, bc );
draw_rectf( x, y, w, h,
FL_BACKGROUND_COLOR == bc || FL_BACKGROUND2_COLOR == bc
? fl_darker(interior_color(bc))
: interior_color( bc ) );
/* draw_rect( x, y, w, h, bc ); */
draw_rect( x+1, y+1, w-2, h-2, bc );
draw_rect( x, y, w, h, outer_border_color( bc ) );
}

static void border_box(int x, int y, int w, int h, Fl_Color bc)
@@ -120,6 +139,9 @@ static void border_box(int x, int y, int w, int h, Fl_Color bc)
cairo_color( interior_color( bc ) );
fl_rectf( x, y, w, h );
cairo_color( border_color( bc ) );
/* fl_rect( x, y, w, h, bc ); */
fl_rect( x+1, y+1, w-2, h-2, bc );
cairo_color( outer_border_color( bc ) );
fl_rect( x, y, w, h, bc );
}



Loading…
Cancel
Save