Skip to content

feat: per-entity foreground/background color overrides in BarSettings#47

Open
Copilot wants to merge 5 commits intomainfrom
copilot/add-configurable-colors-in-bar-settings
Open

feat: per-entity foreground/background color overrides in BarSettings#47
Copilot wants to merge 5 commits intomainfrom
copilot/add-configurable-colors-in-bar-settings

Conversation

Copy link

Copilot AI commented Feb 21, 2026

  • Add optional foreground_color: Option<ForegroundColor> and background_color: Option<Color> fields to BarSettings<T> in configuration.rs
  • Update spawn in plugin.rs to resolve effective colors: use per-entity overrides from BarSettings if present, fall back to global ColorScheme<T> resource
  • Update update_settings in plugin.rs to also update colors when BarSettings changes (needs ColorScheme<T> param)
  • Extract shared color resolution into resolve_colors helper to avoid duplication
  • Add examples/ally_enemy.rs demonstrating enemy (red) vs. friendly (blue) health bars using the same Health component with different per-entity colors in BarSettings
  • Fix CI: add libwayland-dev to system library installs (required by bevy 0.17 wayland-sys dependency)
  • Remove rustdoc comment from private resolve_colors helper
  • Add "Per-Entity Color Overrides" section to README with code example and reference to ally_enemy example
Original prompt

This section details on the original issue you should resolve

<issue_title>ColorScheme should be configurable from BarSettings IMO</issue_title>
<issue_description>It seems inconsistent that foreground and background color are defined per Component type, but border color is defined per Entity in BarSettings.

Use case: player and enemies both have a Health bar. I want them to have different colors, but the behavior is the same. Currently, it seems that the only way to do this is to make Health generic (Health<Enemy>, Health<Player>), this is really inconvenient though as it means all systems that modify Health now also need to be generic.</issue_description>

<agent_instructions>extend on the current solution in a non-breaking way so that the fore and background color can be configured per entity and override the global defined per component type. add an example that demonstrates an enemy health bar vs friendly health bar</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@sparten11740 sounds reasonable - how about making this configurable per entity in addition to the existing way to make this less of a breaking change and have the per-entity config take precedence if present?

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Add configurable colors for foreground and background in BarSettings feat: per-entity foreground/background color overrides in BarSettings Feb 21, 2026
Copilot AI requested a review from sparten11740 February 21, 2026 15:06
@sparten11740
Copy link
Owner

@copilot build in the CI is failing, make sure it passes. Also remove the rustdoc from resolve_colors

…olve_colors

Co-authored-by: sparten11740 <2863630+sparten11740@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 21, 2026

@copilot build in the CI is failing, make sure it passes. Also remove the rustdoc from resolve_colors

Fixed in 9d954b7:

  • Added libwayland-dev to the CI apt-get install step — this is the missing system library that wayland-sys (a bevy 0.17 dependency) requires on Linux
  • Removed the rustdoc comment from resolve_colors

@sparten11740 sparten11740 marked this pull request as ready for review February 21, 2026 20:59
@sparten11740
Copy link
Owner

@copilot add a very short paragraph to the README that outlines how to use this

Co-authored-by: sparten11740 <2863630+sparten11740@users.noreply.github.com>
Copy link
Author

Copilot AI commented Mar 2, 2026

@copilot add a very short paragraph to the README that outlines how to use this

Added a "Per-Entity Color Overrides" section to the README in b2f3fe6, placed right after the BarSettings usage snippet. It briefly explains when to use per-entity colors over the global ColorScheme, includes an ally/enemy code example, and links to the ally_enemy example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ColorScheme should be configurable from BarSettings IMO

2 participants