Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions DasharoPayloadPkg/DasharoColorTheme.dsc.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 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.PcdBrowserErrorTextColor|0x0C # Bright Red 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
2 changes: 2 additions & 0 deletions DasharoPayloadPkg/DasharoPayloadPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,8 @@ OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrd
gEfiMdePkgTokenSpaceGuid.PcdFSBClock|1000000000
!endif

!include DasharoPayloadPkg/DasharoColorTheme.dsc.inc

[PcdsDynamicHii]
!if $(TPM_ENABLE) == TRUE
gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS
Expand Down
45 changes: 25 additions & 20 deletions MdeModulePkg/Library/CustomizedDisplayLib/Colors.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,30 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
//
// Screen Color Settings
//
#define PICKLIST_HIGHLIGHT_TEXT EFI_WHITE
#define PICKLIST_HIGHLIGHT_BACKGROUND EFI_BACKGROUND_CYAN
#define TITLE_TEXT EFI_WHITE
#define TITLE_BACKGROUND EFI_BACKGROUND_BLUE
#define KEYHELP_TEXT EFI_LIGHTGRAY
#define KEYHELP_BACKGROUND EFI_BACKGROUND_BLACK
#define SUBTITLE_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
#define BANNER_TEXT EFI_BLUE
#define BANNER_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
#define FIELD_TEXT_GRAYED EFI_DARKGRAY
#define FIELD_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
#define POPUP_TEXT EFI_LIGHTGRAY
#define POPUP_BACKGROUND EFI_BACKGROUND_BLUE
#define POPUP_INVERSE_TEXT EFI_LIGHTGRAY
#define POPUP_INVERSE_BACKGROUND EFI_BACKGROUND_BLACK
#define HELP_TEXT EFI_BLUE
#define ERROR_TEXT EFI_RED | EFI_BRIGHT
#define INFO_TEXT EFI_YELLOW | EFI_BRIGHT
#define ARROW_TEXT EFI_RED | EFI_BRIGHT
#define ARROW_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
#define PICKLIST_HIGHLIGHT_TEXT PcdGet8 (PcdBrowserPickListTextColor)
#define PICKLIST_HIGHLIGHT_BACKGROUND PcdGet8 (PcdBrowserPickListBackgroundColor)
#define TITLE_TEXT PcdGet8 (PcdBrowserTitleTextColor)
#define TITLE_BACKGROUND PcdGet8 (PcdBrowserTitleBackgroundColor)
#define KEYHELP_TEXT PcdGet8 (PcdBrowserKeyHelpTextColor)
#define KEYHELP_BACKGROUND PcdGet8 (PcdBrowserKeyHelpBackgroundColor)
#define SUBTITLE_TEXT PcdGet8 (PcdBrowserSubtitleTextColor)
#define BANNER_TEXT PcdGet8 (PcdBrowserBannerTextColor)
#define BANNER_BACKGROUND PcdGet8 (PcdBrowserBannerBackgroundColor)
#define FIELD_TEXT PcdGet8 (PcdBrowserFieldTextColor)
#define FIELD_TEXT_GRAYED PcdGet8 (PcdBrowserFieldGrayedTextColor)
#define FIELD_BACKGROUND PcdGet8 (PcdBrowserFieldBackgroundColor)
#define FIELD_TEXT_HIGHLIGHT PcdGet8 (PcdBrowserFieldTextHighlightColor)
#define FIELD_BACKGROUND_HIGHLIGHT PcdGet8 (PcdBrowserFieldBackgroundHighlightColor)
#define POPUP_TEXT PcdGet8 (PcdBrowserPopupTextColor)
#define POPUP_BACKGROUND PcdGet8 (PcdBrowserPopupBackgroundColor)
#define POPUP_INVERSE_TEXT PcdGet8 (PcdBrowserPopupInverseTextColor)
#define POPUP_INVERSE_BACKGROUND PcdGet8 (PcdBrowserPopupInverseBackgroundColor)
#define HELP_TEXT PcdGet8 (PcdBrowserHelpTextColor)
#define HELP_BACKGROUND PcdGet8 (PcdBrowserHelpBackgroundColor)
#define ERROR_TEXT PcdGet8 (PcdBrowserErrorTextColor)
#define INFO_TEXT PcdGet8 (PcdBrowserInfoTextColor)
#define INFO_BACKGROUND PcdGet8 (PcdBrowserInfoBackgroundColor)
#define ARROW_TEXT PcdGet8 (PcdBrowserArrowTextColor)
#define ARROW_BACKGROUND PcdGet8 (PcdBrowserArrowBackgroundColor)

#endif
12 changes: 6 additions & 6 deletions MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -854,7 +854,7 @@ GetInfoTextColor (
VOID
)
{
return INFO_TEXT | FIELD_BACKGROUND;
return INFO_TEXT | INFO_BACKGROUND;
}

/**
Expand All @@ -868,7 +868,7 @@ GetHelpTextColor (
VOID
)
{
return HELP_TEXT | FIELD_BACKGROUND;
return HELP_TEXT | HELP_BACKGROUND;
}

/**
Expand Down Expand Up @@ -896,7 +896,7 @@ GetHighlightTextColor (
VOID
)
{
return PcdGet8 (PcdBrowserFieldTextHighlightColor) | PcdGet8 (PcdBrowserFieldBackgroundHighlightColor);
return FIELD_TEXT_HIGHLIGHT | FIELD_BACKGROUND_HIGHLIGHT;
}

/**
Expand All @@ -910,7 +910,7 @@ GetFieldTextColor (
VOID
)
{
return PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND;
return FIELD_TEXT | FIELD_BACKGROUND;
}

/**
Expand All @@ -924,7 +924,7 @@ GetSubTitleTextColor (
VOID
)
{
return PcdGet8 (PcdBrowserSubtitleTextColor) | FIELD_BACKGROUND;
return SUBTITLE_TEXT | FIELD_BACKGROUND;
}

/**
Expand Down
21 changes: 21 additions & 0 deletions MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,27 @@
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextHighlightColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdFrontPageFormSetGuid ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleBackgroundColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupBackgroundColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerBackgroundColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpBackgroundColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserErrorTextColor ## CONSUMES
42 changes: 42 additions & 0 deletions MdeModulePkg/MdeModulePkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -2001,6 +2001,48 @@
# @ValidList 0x80000005 | 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundHighlightColor|0x00|UINT8|0x0001005A

gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleBackgroundColor|0x10|UINT8|0x00010300
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserTitleTextColor|0x07|UINT8|0x00010301
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupBackgroundColor|0x10|UINT8|0x00010302
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupTextColor|0x07|UINT8|0x00010303
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseBackgroundColor|0x00|UINT8|0x00010304
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPopupInverseTextColor|0x07|UINT8|0x00010305
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpTextColor|0x01|UINT8|0x00010306
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserHelpBackgroundColor|0x70|UINT8|0x00010307
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoTextColor|0x0F|UINT8|0x00010308
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserInfoBackgroundColor|0x70|UINT8|0x00010309
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldBackgroundColor|0x70|UINT8|0x0001030A
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerBackgroundColor|0x70|UINT8|0x0001030B
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserBannerTextColor|0x01|UINT8|0x0001030C
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpTextColor|0x00|UINT8|0x0001030D
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserKeyHelpBackgroundColor|0x07|UINT8|0x0001030E
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListTextColor|0x0F|UINT8|0x0001030F
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserPickListBackgroundColor|0x30|UINT8|0x00010310
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowTextColor|0x0C|UINT8|0x00010311
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserArrowBackgroundColor|0x70|UINT8|0x00010312
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldGrayedTestColor|0x70|UINT8|0x00010313
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserErrorTextColor|0x0C|UINT8|0x00010314

gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlack | { 0x00, 0x00, 0x00, 0x00 } | VOID* | 0x00010400
gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBlue | { 0x00, 0x00, 0x00, 0x98 } | VOID* | 0x00010401
gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteGreen | { 0x00, 0x00, 0x98, 0x00 } | VOID* | 0x00010402
gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteCyan | { 0x00, 0x00, 0x98, 0x98 } | VOID* | 0x00010403
gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteRed | { 0x00, 0x98, 0x00, 0x00 } | VOID* | 0x00010404
gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightMagenta | { 0x00, 0x98, 0x00, 0x98 } | VOID* | 0x00010405
gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteBrown | { 0x00, 0x98, 0x98, 0x00 } | VOID* | 0x00010406
gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGray | { 0x00, 0x98, 0x98, 0x98 } | VOID* | 0x00010407

gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteDarkGray | { 0x00, 0x30, 0x30, 0x30 } | VOID* | 0x00010408
gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightBlue | { 0x00, 0x00, 0x00, 0xFF } | VOID* | 0x00010409
gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightGreen | { 0x00, 0x00, 0xFF, 0x00 } | VOID* | 0x0001040A
gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightCyan | { 0x00, 0xFF, 0xFF, 0x00 } | VOID* | 0x0001040B
gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed | { 0x00, 0xFF, 0x00, 0x00 } | VOID* | 0x0001040C
gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta | { 0x00, 0xFF, 0x00, 0xFF } | VOID* | 0x0001040D
gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteYellow | { 0x00, 0xFF, 0xFF, 0x00 } | VOID* | 0x0001040E
gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteWhite | { 0x00, 0xFF, 0xFF, 0xFF } | VOID* | 0x0001040F
Comment on lines +2026 to +2042

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the redundant spaces. They are not even aligned properly for readability

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought they helped with readibility by splitting it into two blocks of 8 each.
Can remove, sure

@miczyg1 miczyg1 Jun 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the spaces near the pipes |, e.g.

  gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteLightRed        | { 0x00, 0xFF, 0x00, 0x00 } | VOID* | 0x0001040C
  gEfiMdeModulePkgTokenSpaceGuid.PcdGraphicsConsoleColorPaletteMagenta    | { 0x00, 0xFF, 0x00, 0xFF } | VOID* | 0x0001040D

See? Eveywhere else in the repo there is no space around pipe character |, so I would do the same here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, I see now 👍




## Time in second to delay for SATA devices to spin-up for recovery.
# @Prompt SATA spin-up delay time in second for recovery path.
gEfiMdeModulePkgTokenSpaceGuid.PcdSataSpinUpDelayInSecForRecoveryPath|15|UINT16|0x0001005B
Expand Down
68 changes: 47 additions & 21 deletions MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,53 @@ EFI_GUID mFontPackageListGuid = {
0xf5f219d3, 0x7006, 0x4648, { 0xac, 0x8d, 0xd6, 0x1d, 0xfb, 0x7b, 0xc6, 0xad }
};


CHAR16 mCrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL };

EFI_GRAPHICS_OUTPUT_BLT_PIXEL mGraphicsEfiColors[16] = {
//
// B G R reserved
//
{ 0x00, 0x00, 0x00, 0x00 }, // BLACK
{ 0x98, 0x00, 0x00, 0x00 }, // LIGHTBLUE
{ 0x00, 0x98, 0x00, 0x00 }, // LIGHGREEN
{ 0x98, 0x98, 0x00, 0x00 }, // LIGHCYAN
{ 0x00, 0x00, 0x98, 0x00 }, // LIGHRED
{ 0x98, 0x00, 0x98, 0x00 }, // MAGENTA
{ 0x00, 0x98, 0x98, 0x00 }, // BROWN
{ 0x98, 0x98, 0x98, 0x00 }, // LIGHTGRAY
{ 0x30, 0x30, 0x30, 0x00 }, // DARKGRAY - BRIGHT BLACK
{ 0xff, 0x00, 0x00, 0x00 }, // BLUE
{ 0x00, 0xff, 0x00, 0x00 }, // LIME
{ 0xff, 0xff, 0x00, 0x00 }, // CYAN
{ 0x00, 0x00, 0xff, 0x00 }, // RED
{ 0xff, 0x00, 0xff, 0x00 }, // FUCHSIA
{ 0x00, 0xff, 0xff, 0x00 }, // YELLOW
{ 0xff, 0xff, 0xff, 0x00 } // WHITE
};
EFI_GRAPHICS_OUTPUT_BLT_PIXEL mGraphicsEfiColors[16];

/**
test
@param dest Protocol instance pointer.
@param source Handle of device to test.
**/
VOID
CopyGraphicsPaletteColor(
OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL* dest,
IN VOID* source
) {
dest->Reserved = ((UINT8*)source)[0];
dest->Red = ((UINT8*)source)[1];
dest->Green = ((UINT8*)source)[2];
dest->Blue = ((UINT8*)source)[3];
}

/**
test
**/
VOID
InitGraphicsColors (
VOID
)
{
CopyGraphicsPaletteColor(&mGraphicsEfiColors[0], PcdGetPtr(PcdGraphicsConsoleColorPaletteBlack));
Comment thread
miczyg1 marked this conversation as resolved.
CopyGraphicsPaletteColor(&mGraphicsEfiColors[1], PcdGetPtr(PcdGraphicsConsoleColorPaletteBlue));
CopyGraphicsPaletteColor(&mGraphicsEfiColors[2], PcdGetPtr(PcdGraphicsConsoleColorPaletteGreen));
CopyGraphicsPaletteColor(&mGraphicsEfiColors[3], PcdGetPtr(PcdGraphicsConsoleColorPaletteCyan));
CopyGraphicsPaletteColor(&mGraphicsEfiColors[4], PcdGetPtr(PcdGraphicsConsoleColorPaletteRed));
CopyGraphicsPaletteColor(&mGraphicsEfiColors[5], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightMagenta));
CopyGraphicsPaletteColor(&mGraphicsEfiColors[6], PcdGetPtr(PcdGraphicsConsoleColorPaletteBrown));
CopyGraphicsPaletteColor(&mGraphicsEfiColors[7], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGray));
CopyGraphicsPaletteColor(&mGraphicsEfiColors[8], PcdGetPtr(PcdGraphicsConsoleColorPaletteDarkGray));
CopyGraphicsPaletteColor(&mGraphicsEfiColors[9], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightBlue));
CopyGraphicsPaletteColor(&mGraphicsEfiColors[10], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightGreen));
CopyGraphicsPaletteColor(&mGraphicsEfiColors[11], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightCyan));
CopyGraphicsPaletteColor(&mGraphicsEfiColors[12], PcdGetPtr(PcdGraphicsConsoleColorPaletteLightRed));
CopyGraphicsPaletteColor(&mGraphicsEfiColors[13], PcdGetPtr(PcdGraphicsConsoleColorPaletteMagenta));
CopyGraphicsPaletteColor(&mGraphicsEfiColors[14], PcdGetPtr(PcdGraphicsConsoleColorPaletteYellow));
CopyGraphicsPaletteColor(&mGraphicsEfiColors[15], PcdGetPtr(PcdGraphicsConsoleColorPaletteWhite));
}


EFI_NARROW_GLYPH mCursorGlyph = {
0x0000,
Expand Down Expand Up @@ -365,6 +389,8 @@ InitializeGraphicsConsoleTextMode (
//
*TextModeCount = ValidCount;
*TextModeData = NewModeBuffer;

InitGraphicsColors();
return EFI_SUCCESS;
}

Expand Down
Loading
Loading