feat: strip alpha channel from color_hex for Spoolman API / AFC compatibility#4
Draft
akira69 wants to merge 1 commit into
Draft
feat: strip alpha channel from color_hex for Spoolman API / AFC compatibility#4akira69 wants to merge 1 commit into
akira69 wants to merge 1 commit into
Conversation
b8836ab to
80392a0
Compare
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.
Status
Draft / in work. This should stay draft until the dependent FilaMan system alpha-color work is accepted upstream.
The referenced FilaMan system PR is fork-only right now:
akira69/filaman-system#7. It has not been submitted to or merged byFire-Devils/filaman-systemyet.Summary
Prepare the Spoolman API plugin for possible future FilaMan alpha color support by ensuring outbound Spoolman-compatible responses still expose plain six-character RGB colors.
The fork-only FilaMan system PR #7 stores alpha-capable colors canonically as
#RRGGBBAA. Spoolman's REST API documentation sayscolor_hexandmulti_color_hexessupport alpha at the end, but AFC / BoxTurtle integrations expect usable six-characterRRGGBBlane colors. This plugin should therefore export the visible RGB portion only if that system change lands upstream.What changed
Adds
SpoolmanService._to_rgb_hex()and uses it for:color_hexmulti_color_hexesBehavior:
#BE000022BE0000#00D4D48800D4D4#FFFFFF00FFFFFF#FF0000FF0000Important correction
Earlier notes described the future format as
#AARRGGBB. That was wrong for current Spoolman / CSS-compatible alpha semantics. The correct canonical format is#RRGGBBAA, so this PR strips trailing alpha by taking the first six hex characters.Validation
PYTHONPYCACHEPREFIX=/private/tmp/filaman-spoolmanapi-pycache python3 -m compileall spoolmanapigit diff --checkRelationship to FilaMan system alpha-color work
This plugin PR is only needed if/when the alpha-capable color storage work from
akira69/filaman-system#7is submitted to and accepted by upstream FilaMan. Until then, this plugin PR should remain draft. Its purpose is to keep external Spoolman-compatible consumers from receiving 8-character color values where they expect RGB lane colors.