-
-
Notifications
You must be signed in to change notification settings - Fork 11
Setup menu color customization #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
philipanda
wants to merge
10
commits into
dasharo
Choose a base branch
from
setup-menu-color-customization
base: dasharo
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2727e2d
MdeModulePkg: Make graphics console colors into PCDs
philipanda 8b6b5bd
DasharoPayloadPkg.dsc: Add custom color palette
philipanda b7aa39d
MdeModulePkg: Add CustomizedDisplayLib grayed text color pcd
philipanda 8ae3239
DasharoPayloadPkg.dsc: Add CustomizedDisplayLib grayed text pcd
philipanda e43903e
DasharoPaloadPkg.dsc: Adjust text colors
philipanda f248acb
DasharoColorTheme.dsc.inc: Move color theme to a file
philipanda 1d0c1ba
DasharoColorTheme.dsc.inc: Add comments describing colors
philipanda 2f5c91b
TerminalDxe: Use PCD color schemes & 24b colors in terminal
philipanda a91e241
MdeModulePkg.dec & all deps: fix invalid vga color names
philipanda c426ae7
TerminalConOut.c: Revert clearing bright bit for foreground control
philipanda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # Color codes defined at MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c | ||
| # Foregrounds: | ||
| # 0x00 (EFI_BLACK) | ||
| # 0x01 (EFI_BLUE) | ||
| # 0x02 (EFI_GREEN) | ||
| # 0x03 (EFI_CYAN) | ||
| # 0x04 (EFI_RED) | ||
| # 0x05 (EFI_MAGENTA) | ||
| # 0x06 (EFI_BROWN) | ||
| # 0x07 (EFI_LIGHTGRAY) | ||
| # 0x08 (EFI_DARKGRAY) | ||
| # 0x09 (EFI_LIGHTBLUE) | ||
| # 0x0A (EFI_LIGHTGREEN) | ||
| # 0x0B (EFI_LIGHTCYAN) | ||
| # 0x0C (EFI_LIGHTRED) | ||
| # 0x0D (EFI_LIGHTMAGENTA) | ||
| # 0x0E (EFI_YELLOW) | ||
| # 0x0F (EFI_WHITE) | ||
| # | ||
| # Backgrounds: | ||
| # 0x00 (EFI_BACKGROUND_BLACK) | ||
| # 0x10 (EFI_BACKGROUND_BLUE) | ||
| # 0x20 (EFI_BACKGROUND_GREEN) | ||
| # 0x30 (EFI_BACKGROUND_CYAN) | ||
| # 0x40 (EFI_BACKGROUND_RED) | ||
| # 0x50 (EFI_BACKGROUND_MAGENTA) | ||
| # 0x60 (EFI_BACKGROUND_BROWN) | ||
| # 0x70 (EFI_BACKGROUND_LIGHTGRAY) | ||
| # | ||
| # Because the background color in EDK2 does not support the bright bit, only | ||
| # colors 0-7 are available for backgrounds. To use colors like WHITE, some of | ||
| # the colors 0-7 need to be remapped to RGB value of white. | ||
|
|
||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor|0x60 # Grey bg | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor|0x0F # White text | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleBackgroundColor|0x60 # Grey bg | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor|0x0F # White text | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupBackgroundColor|0x60 # Grey bg | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor|0x0F # White text | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor|0x06 # Grey text | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x60 # Grey bg | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor|0x07 # Light grey text | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor|0x30 # White bg | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x06 # Grey text | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor|0x30 # White bg | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor|0x06 # Grey text | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor|0x30 # White bg | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor|0x02 # Green text | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerBackgroundColor|0x60 # Grey bg | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerTextColor|0x0F # White text | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpTextColor|0x02 # Green text | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpBackgroundColor|0x60 # Grey bg | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor|0x06 # Grey text | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor|0x30 # White bg | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor|0x0F # White text | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x60 # Grey bg | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor|0x07 # Light grey text | ||
|
|
||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack | { 0x00, 0x00, 0x00, 0x00 } # 0 Plain black | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0x98 } # 1 Dark green | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteGreen | { 0x00, 0x38, 0xD4, 0x30 } # 2 Dasharo green | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan | { 0x00, 0xFF, 0xFF, 0xFF } # 3 cyan remapped to White for backgrounds | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed | { 0x00, 0x98, 0x00, 0x00 } # 4 Red | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightMagenta | { 0x00, 0x98, 0x00, 0x98 } # 5 Magenta | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown | { 0x00, 0x29, 0x36, 0x3b } # 6 Dasharo grey | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray | { 0x00, 0x80, 0x80, 0x80 } # 7 Light grey | ||
|
|
||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray | { 0x00, 0x30, 0x30, 0x30 } # 8 Dark grey | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0xFF } # 9 Blue | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen | { 0x00, 0x00, 0xFF, 0x00 } # A Green | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan | { 0x00, 0xFF, 0xFF, 0x00 } # B Cyan | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed | { 0x00, 0xFF, 0x00, 0x00 } # C Red | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta | { 0x00, 0xFF, 0x00, 0xFF } # D Fuchsia | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow | { 0x00, 0xFF, 0xFF, 0x00 } # E Yellow | ||
| gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite | { 0x00, 0xFF, 0xFF, 0xFF } # F White | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,7 +153,7 @@ RefreshKeyHelp ( | |
| return; | ||
| } | ||
|
|
||
| gST->ConOut->SetAttribute (gST->ConOut, KEYHELP_TEXT | KEYHELP_BACKGROUND); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if it would not be easier to replace definitions of these macros in -#define KEYHELP_TEXT EFI_LIGHTGRAY
-#define KEYHELP_BACKGROUND EFI_BACKGROUND_BLACK
+#define KEYHELP_TEXT PcdGet8 (PcdBrowserKeyHelpTextColor)
+#define KEYHELP_BACKGROUND PcdGet8 (PcdBrowserKeyHelpBackgroundColor)Then we could remove all those |
||
| gST->ConOut->SetAttribute (gST->ConOut, GetKeyHelpColor()); | ||
|
|
||
| if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) { | ||
| return; | ||
|
|
@@ -534,7 +534,7 @@ CreateDialog ( | |
| // | ||
| // Passing in a space results in the assumption that this is where typing will occur | ||
| // | ||
| ClearLines (Start + 1, End - 1, Index + 1, Index + 1, POPUP_INVERSE_TEXT | POPUP_INVERSE_BACKGROUND); | ||
| ClearLines (Start + 1, End - 1, Index + 1, Index + 1, GetPopupInverseColor()); | ||
| PrintStringAt ( | ||
| ((DimensionsWidth - LibGetStringWidth (String) / 2) / 2) + gScreenDimensions.LeftColumn + 1, | ||
| Index + 1, | ||
|
|
@@ -798,7 +798,21 @@ GetPopupColor ( | |
| VOID | ||
| ) | ||
| { | ||
| return POPUP_TEXT | POPUP_BACKGROUND; | ||
| return PcdGet8 (PcdBrowserPopupTextColor) | PcdGet8 (PcdBrowserPopupBackgroundColor); | ||
| } | ||
|
|
||
| /** | ||
| Get OEM/Vendor specific title colors. | ||
|
|
||
| @retval Byte code color setting for popup color. | ||
| **/ | ||
| UINT8 | ||
| EFIAPI | ||
| GetTitleColor ( | ||
| VOID | ||
| ) | ||
| { | ||
| return PcdGet8 (PcdBrowserTitleTextColor) | PcdGet8 (PcdBrowserTitleBackgroundColor); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -812,7 +826,7 @@ GetPopupInverseColor ( | |
| VOID | ||
| ) | ||
| { | ||
| return POPUP_INVERSE_TEXT | POPUP_INVERSE_BACKGROUND; | ||
| return PcdGet8 (PcdBrowserPopupInverseTextColor) | PcdGet8 (PcdBrowserPopupInverseBackgroundColor); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -826,9 +840,8 @@ GetPickListColor ( | |
| VOID | ||
| ) | ||
| { | ||
| return PICKLIST_HIGHLIGHT_TEXT | PICKLIST_HIGHLIGHT_BACKGROUND; | ||
| return PcdGet8 (PcdBrowserPickListTextColor) | PcdGet8 (PcdBrowserPickListBackgroundColor); | ||
| } | ||
|
|
||
| /** | ||
| Get OEM/Vendor specific arrow color attribute. | ||
|
|
||
|
|
@@ -840,7 +853,7 @@ GetArrowColor ( | |
| VOID | ||
| ) | ||
| { | ||
| return ARROW_TEXT | ARROW_BACKGROUND; | ||
| return PcdGet8 (PcdBrowserArrowTextColor) | PcdGet8 (PcdBrowserArrowBackgroundColor); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -854,7 +867,7 @@ GetInfoTextColor ( | |
| VOID | ||
| ) | ||
| { | ||
| return INFO_TEXT | FIELD_BACKGROUND; | ||
| return PcdGet8 (PcdBrowserInfoTextColor) | PcdGet8 (PcdBrowserInfoBackgroundColor); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -868,7 +881,7 @@ GetHelpTextColor ( | |
| VOID | ||
| ) | ||
| { | ||
| return HELP_TEXT | FIELD_BACKGROUND; | ||
| return PcdGet8 (PcdBrowserHelpTextColor) | PcdGet8 (PcdBrowserHelpBackgroundColor); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -882,7 +895,7 @@ GetGrayedTextColor ( | |
| VOID | ||
| ) | ||
| { | ||
| return FIELD_TEXT_GRAYED | FIELD_BACKGROUND; | ||
| return PcdGet8 (PcdBrowserFieldGrayedTestColor) | PcdGet8 (PcdBrowserFieldBackgroundColor); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -910,7 +923,7 @@ GetFieldTextColor ( | |
| VOID | ||
| ) | ||
| { | ||
| return PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND; | ||
| return PcdGet8 (PcdBrowserFieldTextColor) | PcdGet8 (PcdBrowserFieldBackgroundColor); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -924,7 +937,35 @@ GetSubTitleTextColor ( | |
| VOID | ||
| ) | ||
| { | ||
| return PcdGet8 (PcdBrowserSubtitleTextColor) | FIELD_BACKGROUND; | ||
| return PcdGet8 (PcdBrowserSubtitleTextColor) | PcdGet8 (PcdBrowserFieldBackgroundColor); | ||
| } | ||
|
|
||
| /** | ||
| Get OEM/Vendor specific banner text color attribute. | ||
|
|
||
| @retval Byte code color setting for banner text color. | ||
| **/ | ||
| UINT8 | ||
| EFIAPI | ||
| GetBannerColor ( | ||
| VOID | ||
| ) | ||
| { | ||
| return PcdGet8 (PcdBrowserBannerTextColor) | PcdGet8 (PcdBrowserBannerBackgroundColor); | ||
| } | ||
|
|
||
| /** | ||
| Get OEM/Vendor specific key help text color attribute. | ||
|
|
||
| @retval Byte code color setting for key help text color. | ||
| **/ | ||
| UINT8 | ||
| EFIAPI | ||
| GetKeyHelpColor ( | ||
| VOID | ||
| ) | ||
| { | ||
| return PcdGet8 (PcdBrowserKeyHelpTextColor) | PcdGet8 (PcdBrowserKeyHelpBackgroundColor); | ||
| } | ||
|
|
||
| /** | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a newline