MCPcopy Create free account
hub / github.com/audacity/audacity / CursorColour

Function CursorColour

libraries/lib-theme/AColor.cpp:525–538  ·  view source on GitHub ↗

Fix up the cursor colour, if it is 'unacceptable'. Unacceptable if it is too close to the background colour.

Source from the content-addressed store, hash-verified

523// Fix up the cursor colour, if it is 'unacceptable'.
524// Unacceptable if it is too close to the background colour.
525wxColour CursorColour( )
526{
527 wxColour cCursor = theTheme.Colour( clrCursorPen );
528 wxColour cBack = theTheme.Colour( clrMedium );
529
530 int d = theTheme.ColourDistance( cCursor, cBack );
531
532 // Pen colour is fine, if there is plenty of contrast.
533 if( d > 200 )
534 return theTheme.Colour( clrCursorPen );
535
536 // otherwise return same colour as a selection.
537 return theTheme.Colour( clrSelected );
538}
539
540void AColor::Init()
541{

Callers 1

InitMethod · 0.85

Calls 1

ColourDistanceMethod · 0.80

Tested by

no test coverage detected