Skip to content

Commit

Permalink
a11y: tag item contrast
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyTWF committed Dec 28, 2023
1 parent e1c151a commit 8c38c60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/plugin/approach/GlideslopeDeviationTagItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ namespace UKControllerPlugin::Approach {
return;
}

// Set the tag colour based on the deviation
// Set the tag colour to red if we're massively out
if (deviation.deviation > 300) {
tagData.SetTagColour(RGB(255, 87, 51));
} else {
tagData.SetTagColour(RGB(2, 48, 32));
}

// If we're massively out, abbreviate the string
Expand Down
8 changes: 4 additions & 4 deletions test/plugin/approach/GlideslopeDeviationTagItemTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace UKControllerPluginTest::Approach {
glideslopeDeviationTagItem.SetTagItemData(tagData);

EXPECT_EQ("+48", tagData.GetItemString());
EXPECT_EQ(RGB(2, 48, 32), tagData.GetTagColour());
EXPECT_EQ(RGB(255, 255, 255), tagData.GetTagColour());
}

TEST_F(GlideslopeDeviationTagItemTest, ItSetsTagItemDataWellBelowGlideslope)
Expand All @@ -91,7 +91,7 @@ namespace UKControllerPluginTest::Approach {
glideslopeDeviationTagItem.SetTagItemData(tagData);

EXPECT_EQ("-448", tagData.GetItemString());
EXPECT_EQ(RGB(2, 48, 32), tagData.GetTagColour());
EXPECT_EQ(RGB(255, 255, 255), tagData.GetTagColour());
}

TEST_F(GlideslopeDeviationTagItemTest, ItSetsTagItemDataSlightlyBelow)
Expand All @@ -101,7 +101,7 @@ namespace UKControllerPluginTest::Approach {
glideslopeDeviationTagItem.SetTagItemData(tagData);

EXPECT_EQ("-48", tagData.GetItemString());
EXPECT_EQ(RGB(2, 48, 32), tagData.GetTagColour());
EXPECT_EQ(RGB(255, 255, 255), tagData.GetTagColour());
}

TEST_F(GlideslopeDeviationTagItemTest, ItSetsTagItemDataOver1000FeetAboveGlideslope)
Expand All @@ -121,7 +121,7 @@ namespace UKControllerPluginTest::Approach {
glideslopeDeviationTagItem.SetTagItemData(tagData);

EXPECT_EQ("<1k", tagData.GetItemString());
EXPECT_EQ(RGB(2, 48, 32), tagData.GetTagColour());
EXPECT_EQ(RGB(255, 255, 255), tagData.GetTagColour());
}

TEST_F(GlideslopeDeviationTagItemTest, ItDoesntSetTagItemDataIfRunwayNotFound)
Expand Down

0 comments on commit 8c38c60

Please sign in to comment.