Audacity  2.2.2
Functions | Variables
AColor.cpp File Reference
#include "Audacity.h"
#include <wx/window.h>
#include <wx/colour.h>
#include <wx/dc.h>
#include <wx/dcmemory.h>
#include <wx/settings.h>
#include <wx/utils.h>
#include "AColor.h"
#include "Theme.h"
#include "Experimental.h"
#include "AllThemeResources.h"

Go to the source code of this file.

Functions

wxColour InvertOfColour (const wxColour &c)
 
wxColour CursorColour ()
 

Variables

const int AColor_midicolors [16][3]
 

Function Documentation

wxColour CursorColour ( )

Definition at line 445 of file AColor.cpp.

References ThemeBase::Colour(), ThemeBase::ColourDistance(), and theTheme.

Referenced by AColor::Init().

446 {
447  wxColour cCursor = theTheme.Colour( clrCursorPen );
448  wxColour cBack = theTheme.Colour( clrMedium );
449 
450  int d = theTheme.ColourDistance( cCursor, cBack );
451 
452  // Pen colour is fine, if there is plenty of contrast.
453  if( d > 200 )
454  return clrCursorPen;
455 
456  // otherwise return same colour as a selection.
457  return theTheme.Colour( clrSelected );
458 }
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:209
int ColourDistance(wxColour &From, wxColour &To)
Definition: Theme.cpp:366
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1208
wxColour InvertOfColour ( const wxColour &  c)

Definition at line 438 of file AColor.cpp.

439 {
440  return wxColour( 255-c.Red(), 255-c.Green(), 255-c.Blue() );
441 }

Variable Documentation

const int AColor_midicolors[16][3]
Initial value:
= {
{255, 102, 102},
{204, 0, 0},
{255, 117, 23},
{255, 255, 0},
{0, 204, 0},
{0, 204, 204},
{125, 125, 255},
{153, 0, 255},
{140, 97, 54},
{120, 120, 120},
{255, 175, 40},
{102, 255, 102},
{153, 255, 255},
{190, 190, 255},
{204, 102, 255},
{255, 51, 204}
}

Definition at line 548 of file AColor.cpp.