Color code HP on status bar#46
Open
friedev wants to merge 5 commits into
Open
Conversation
Owner
|
I think we can get part way there with css variables. player.js:getBottomLine(): larn.css:mark{}: The catch of course, is that this changes <mark> for everything, not just HP. So we'd have to find a way to separate things. Any ideas? |
friedev
force-pushed
the
color-coded-status
branch
from
July 23, 2026 13:46
647053a to
a71d332
Compare
Contributor
Author
|
@primeau I ended up implementing it a bit more like how
I added some helper functions to make the markup less fragile too. There's a lot more refactoring that could be done with how markup is handled in general, but I didn't want to go too crazy haha. If you're not a fan of the refactors at all, you can drop the commits after 0115171. |
friedev
marked this pull request as ready for review
July 23, 2026 16:41
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Color codes the HP readout according to the fraction of max HP:
Ideally this would change the background highlight too, but that would be a bigger change since
<mark>doesn't accept a custom background color AFAICT. Therefore, I figured I'd send this in as a draft for feedback before attempting to change that.This could also be extended to spells if we want to. Not sure if we'd want to use the same colors and thresholds or something different.