Repository: microsoft/terminal
File: src/cascadia/TerminalCore/terminalrenderdata.cpp (C++)

Code before:
void Terminal::SetFontInfo(const FontInfo& fontInfo)
{
    _fontInfo = fontInfo;
}

const TextAttribute Terminal::GetDefaultBrushColors() noexcept
{
    return TextAttribute{};
}

std::pair<COLORREF, COLORREF> Terminal::GetAttributeColors(const TextAttribute& attr) const noexcept
{
    std::pair<COLORREF, COLORREF> colors;
    _blinkingState.RecordBlinkingUsage(attr);
    const auto fgTextColor = attr.GetForeground();
    const auto bgTextColor = attr.GetBackground();

    // We want to nudge the foreground color to make it more perceivable only for the
    // default color pairs within the color table
    if (_perceptualColorNudging &&
        !(attr.IsFaint() || (attr.IsBlinking() && _blinkingState.IsBlinkingFaint())) &&
        (fgTextColor.IsDefault() || fgTextColor.IsLegacy()) &&
        (bgTextColor.IsDefault() || bgTextColor.IsLegacy()))
    {
        auto bgIndex = bgTextColor.IsDefault() ? DefaultBgIndex : bgTextColor.GetIndex();
        auto fgIndex = fgTextColor.IsDefault() ? DefaultFgIndex : fgTextColor.GetIndex();

        if (fgTextColor.IsIndex16() && (fgIndex < 8) && attr.IsBold() && _intenseIsBright)
        {
            // There is a special case for bold here - we need to get the bright version of the foreground color
            fgIndex += 8;
        }

        if (attr.IsReverseVideo() ^ _screenReversed)
        {
            colors.first = _adjustedForegroundColors[fgIndex][bgIndex];
            colors.second = fgTextColor.GetColor(_colorTable, _defaultFg);
        }
        else
        {
            colors.first = _adjustedForegroundColors[bgIndex][fgIndex];
            colors.second = bgTextColor.GetColor(_colorTable, _defaultBg);
        }
    }
    else
    {
        colors = attr.CalculateRgbColors(_colorTable,
                                         _defaultFg,
                                         _defaultBg,
                                         _screenReversed,
                                         _blinkingState.IsBlinkingFaint(),

Review comment (suggestion):
```suggestion
        const auto bgIndex = bgTextColor.IsDefault() ? DefaultBgIndex : bgTextColor.GetIndex();
        const auto fgIndex = fgTextColor.IsDefault() ? DefaultFgIndex : fgTextColor.GetIndex();
```

Code after:
{
    return _fontInfo;
}

void Terminal::SetFontInfo(const FontInfo& fontInfo)
{
    _fontInfo = fontInfo;
}

const TextAttribute Terminal::GetDefaultBrushColors() noexcept
{
    return TextAttribute{};
}

std::pair<COLORREF, COLORREF> Terminal::GetAttributeColors(const TextAttribute& attr) const noexcept
{
    std::pair<COLORREF, COLORREF> colors;
    _blinkingState.RecordBlinkingUsage(attr);
    const auto fgTextColor = attr.GetForeground();
    const auto bgTextColor = attr.GetBackground();

    // We want to nudge the foreground color to make it more perceivable only for the
    // default color pairs within the color table
    if (_adjustIndistinguishableColors &&
        !(attr.IsFaint() || (attr.IsBlinking() && _blinkingState.IsBlinkingFaint())) &&
        (fgTextColor.IsDefault() || fgTextColor.IsLegacy()) &&
        (bgTextColor.IsDefault() || bgTextColor.IsLegacy()))
    {
        const auto bgIndex = bgTextColor.IsDefault() ? DefaultBgIndex : bgTextColor.GetIndex();
        auto fgIndex = fgTextColor.IsDefault() ? DefaultFgIndex : fgTextColor.GetIndex();

        if (fgTextColor.IsIndex16() && (fgIndex < 8) && attr.IsBold() && _intenseIsBright)
        {
            // There is a special case for bold here - we need to get the bright version of the foreground color
            fgIndex += 8;
        }

        if (attr.IsReverseVideo() ^ _screenReversed)
        {
            colors.first = _adjustedForegroundColors[fgIndex][bgIndex];
            colors.second = fgTextColor.GetColor(_colorTable, _defaultFg);
        }
        else
        {
            colors.first = _adjustedForegroundColors[bgIndex][fgIndex];
            colors.second = bgTextColor.GetColor(_colorTable, _defaultBg);
        }
    }
    else
    {
        colors = attr.CalculateRgbColors(_colorTable,