Colour the callsign the way N1MM colours it, and mark the call

The colours are N1MM's own defaults, read out of ApplicationStyles: blue
for a station worth working, red for one new multiplier, green for more
than one, grey for a dupe, and red on the CQ frequency line. A call under
three characters stays blue, as N1MM leaves it.

The mark at the right-hand end of the callsign box is N1MM's OKCall: a
tick when the call is in MASTER.SCP, a question mark while it is not, in
the colour of the call. Like N1MM it only shows while the check window is
open, for three characters or more, and only while the call is short
enough to leave room for it.

The band under the boxes takes N1MM's background colours instead of white
on the text colours. The two lights, the telnet window and the message
editor were borrowing the verdict brushes for things that are not
verdicts; they have their own colours now.

The callsign and the exchange boxes uppercase what is typed. Name and
comment do not, which is what N1MM does.

Scored contest 63 of om5m.s3db (CQ WW SSB, 3775 QSOs) against the points
and multiplier flags N1MM stored: points identical, multipliers 601
against 602. The difference is B1Z on 10m, which N1MM logged with an
empty country prefix and counted as a country of its own though BY was
already worked on that band.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-28 12:50:56 +00:00
co-authored by Claude Opus 5
parent 1c118f9ce4
commit e4b3dc9572
5 changed files with 139 additions and 23 deletions
+39 -10
View File
@@ -3,21 +3,50 @@ using Nonemm.Contests;
namespace Nonemm.App;
/// One place decides what colour a station is, so the frame round the callsign
/// box, a row in the check window and a spot on the bandmap cannot disagree.
/// One place decides what colour a station is, so the callsign box, the frame
/// above it, a row in the check window and a spot on the bandmap cannot
/// disagree. The colours are N1MM's own defaults, from ApplicationStyles:
/// QColor, MultColor, MultiMultColor and DupeColor.
public static class Verdicts
{
public static readonly IBrush Dupe = new SolidColorBrush(Color.FromRgb(0xC0, 0x39, 0x2B));
public static readonly IBrush NewMultiplier = new SolidColorBrush(Color.FromRgb(0x27, 0xAE, 0x60));
public static readonly IBrush Worth = new SolidColorBrush(Color.FromRgb(0x29, 0x80, 0xB9));
public static readonly IBrush Nothing = new SolidColorBrush(Color.FromRgb(0x7F, 0x8C, 0x8D));
/// Worth a contact but no new multiplier.
public static readonly IBrush Worth = new SolidColorBrush(Color.FromRgb(0x00, 0x00, 0xFF));
/// New in one multiplier.
public static readonly IBrush NewMultiplier = new SolidColorBrush(Color.FromRgb(0xE8, 0x00, 0x00));
/// New in more than one, which is worth turning the radio for.
public static readonly IBrush NewMultipliers = new SolidColorBrush(Color.FromRgb(0x0D, 0x9D, 0x0D));
public static readonly IBrush Dupe = new SolidColorBrush(Color.FromRgb(0x80, 0x80, 0x80));
public static readonly IBrush Nothing = Dupe;
/// The frequency we are calling CQ on.
public static readonly IBrush Cq = new SolidColorBrush(Color.FromRgb(0xFF, 0x00, 0x00));
/// Nothing typed yet is the same blue as a station worth working: that is
/// what N1MM leaves the callsign box.
public static IBrush Colour(Verdict? verdict) =>
verdict is null ? Nothing
verdict is null ? Worth
: verdict.IsDupe ? Dupe
: verdict.IsNewMultiplier ? NewMultiplier
: verdict.Points > 0 ? Worth
: Nothing;
: verdict.NewMultipliers.Count > 1 ? NewMultipliers
: verdict.NewMultipliers.Count == 1 ? NewMultiplier
: Worth;
/// The same four states as backgrounds, which is what N1MM paints behind a
/// spot: QBackColor, MultBackColor and DupeBackColor.
public static IBrush Background(Verdict? verdict) =>
verdict is null ? WorthBack
: verdict.IsDupe ? DupeBack
: verdict.NewMultipliers.Count > 0 ? MultiplierBack
: WorthBack;
private static readonly IBrush WorthBack = new SolidColorBrush(Color.FromRgb(0x51, 0xA8, 0xFF));
private static readonly IBrush MultiplierBack = new SolidColorBrush(Color.FromRgb(0xFF, 0x37, 0x37));
private static readonly IBrush DupeBack = new SolidColorBrush(Color.FromRgb(0xD4, 0xD4, 0xD4));
public static string Describe(Verdict? verdict)
{