Skip to content

feat: strip alpha channel from color_hex for Spoolman API / AFC compatibility#4

Draft
akira69 wants to merge 1 commit into
Fire-Devils:mainfrom
akira69:feat/alpha-compat-hex-strip
Draft

feat: strip alpha channel from color_hex for Spoolman API / AFC compatibility#4
akira69 wants to merge 1 commit into
Fire-Devils:mainfrom
akira69:feat/alpha-compat-hex-strip

Conversation

@akira69

@akira69 akira69 commented May 29, 2026

Copy link
Copy Markdown

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 by Fire-Devils/filaman-system yet.

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 says color_hex and multi_color_hexes support alpha at the end, but AFC / BoxTurtle integrations expect usable six-character RRGGBB lane 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:

  • primary color_hex
  • multi-color multi_color_hexes
  • non-primary color list handling

Behavior:

Stored FilaMan value Spoolman API output
#BE000022 BE0000
#00D4D488 00D4D4
#FFFFFF00 FFFFFF
#FF0000 FF0000

Important 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 spoolmanapi
  • git diff --check

Relationship to FilaMan system alpha-color work

This plugin PR is only needed if/when the alpha-capable color storage work from akira69/filaman-system#7 is 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.

@akira69 akira69 force-pushed the feat/alpha-compat-hex-strip branch from b8836ab to 80392a0 Compare May 31, 2026 21:25
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.

1 participant