Skip to content

fix: fixed font color when use background color#750

Merged
9aoy merged 2 commits intomainfrom
fixed-font-color
Dec 10, 2025
Merged

fix: fixed font color when use background color#750
9aoy merged 2 commits intomainfrom
fixed-font-color

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Dec 10, 2025

Summary

fix font color in different terminal when use background color.

img_v3_02sr_8641092b-dda2-4eef-8151-56e549a073cg

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings December 10, 2025 03:38
@netlify
Copy link
Copy Markdown

netlify bot commented Dec 10, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 8fe00eb
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/6938ef322d55ce0007f9cc1e
😎 Deploy Preview https://deploy-preview-750--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes terminal font color readability issues by introducing a bgColor helper function that automatically applies appropriate contrasting text colors (white for dark backgrounds like red/black, dark for light backgrounds) when using background colors. This ensures consistent and readable output across different terminal themes.

Key Changes

  • Created a centralized bgColor helper function that applies both background colors and appropriate contrasting foreground colors
  • Replaced direct color.bgRed() and color.bgYellow() calls with the new helper
  • Ensures all status labels (FAIL, RUNS) are consistently bolded with proper contrast

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/core/src/utils/helper.ts Added new bgColor helper function with BackgroundColor type definition to centralize color contrast logic
packages/core/src/reporter/summary.ts Updated FAIL status label to use bgColor helper for proper text contrast
packages/core/src/reporter/statusRenderer.ts Updated RUNS status label to use bgColor helper for proper text contrast
packages/core/src/core/listTests.ts Updated FAIL status label to use bgColor helper for proper text contrast

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@9aoy 9aoy merged commit cb37bff into main Dec 10, 2025
16 checks passed
@9aoy 9aoy deleted the fixed-font-color branch December 10, 2025 04:04
@9aoy 9aoy mentioned this pull request Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants