Skip to content

Allow us to use loadPalette() by moving from protected to public#5535

Open
BobLoeffler68 wants to merge 7 commits intowled:mainfrom
BobLoeffler68:loadPalette
Open

Allow us to use loadPalette() by moving from protected to public#5535
BobLoeffler68 wants to merge 7 commits intowled:mainfrom
BobLoeffler68:loadPalette

Conversation

@BobLoeffler68
Copy link
Copy Markdown
Contributor

@BobLoeffler68 BobLoeffler68 commented Apr 25, 2026

We currently cannot use loadPalette() to change palettes via the code because it's a protected member, not a public member. I want to use it to load random palettes in an FX, so I have moved loadPalette() to the Public section in FX.h I tested the change and it works.

Summary by CodeRabbit

  • Refactor

    • Palette loading accessibility changed to be publicly available for direct use.
  • Style

    • Whitespace normalization performed in one effect (formatting only; no behavioral changes).

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fc58798a-71bb-4170-932a-cd634ad5bb70

📥 Commits

Reviewing files that changed from the base of the PR and between 549cde0 and 1b686b3.

📒 Files selected for processing (1)
  • wled00/FX.h
🚧 Files skipped from review as they are similar to previous changes (1)
  • wled00/FX.h

Walkthrough

Whitespace normalization in a usermod source file and a visibility change in the FX header: Segment::loadPalette is promoted from protected to public; no implementation logic changes.

Changes

Cohort / File(s) Summary
Whitespace Normalization
usermods/user_fx/user_fx.cpp
Whitespace-only formatting adjustments in mode_spinning_wheel around virtualStrip and variable initializations; no logic changes.
Public Interface Change
wled00/FX.h
Moved Segment::loadPalette(CRGBPalette16 &tgt, uint8_t pal) from protected to public, making the method callable from external code; signature unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Palettes fix #5263 — Modifies Segment::loadPalette implementation and palette handling; touches the same function and is closely related.

Suggested reviewers

  • DedeHai
  • Aircoookie
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: exposing the loadPalette() method by moving it from protected to public access in FX.h.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added the effect label Apr 25, 2026
@DedeHai
Copy link
Copy Markdown
Collaborator

DedeHai commented Apr 25, 2026

looks good, please revert the unrelated whitespace changes, also move the changed line up by one not leaving a blank line before it.

@BobLoeffler68
Copy link
Copy Markdown
Contributor Author

looks good, please revert the unrelated whitespace changes, also move the changed line up by one not leaving a blank line before it.

Done. Thx.

@blazoncek
Copy link
Copy Markdown
Contributor

FYI there are other places in WLED code that could use public method.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants