Fix up the cursor colour, if it is 'unacceptable'. Unacceptable if it is too close to the background colour.
| 523 | // Fix up the cursor colour, if it is 'unacceptable'. |
| 524 | // Unacceptable if it is too close to the background colour. |
| 525 | wxColour 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 | |
| 540 | void AColor::Init() |
| 541 | { |