Skip to content

Fix macOS build error: remove juce::Graphics::getCurrentColour() call - #12

Merged
GizzZmo merged 1 commit into
mainfrom
copilot/fix-cyberpunk-look-and-feel-error
Apr 25, 2026
Merged

Fix macOS build error: remove juce::Graphics::getCurrentColour() call#12
GizzZmo merged 1 commit into
mainfrom
copilot/fix-cyberpunk-look-and-feel-error

Conversation

Copilot AI commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Description

juce::Graphics does not expose getCurrentColour() in JUCE 7.0.9, causing a hard compile error on macOS. Replace the two-step colour lookup with an explicit local variable computed from the same source values.

Before:

g.setColour(button.getToggleState() ? matrixGreen : matrixGray);
if (shouldDrawButtonAsHighlighted)
    g.setColour(g.getCurrentColour().brighter(0.2f));

After:

auto textColour = button.getToggleState() ? matrixGreen : matrixGray;
if (shouldDrawButtonAsHighlighted)
    textColour = textColour.brighter (0.2f);
g.setColour (textColour);

Behavior is identical; only the non-existent API call is removed.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Testing

  • Tested in DAW (specify which one):
  • Verified VST3 functionality
  • Verified AU functionality (macOS only)
  • Tested on platform(s): macOS (JUCE 7.0.9)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

@GizzZmo
GizzZmo marked this pull request as ready for review April 25, 2026 17:34
Copilot AI review requested due to automatic review settings April 25, 2026 17:34
@GizzZmo
GizzZmo merged commit f5b0d08 into main Apr 25, 2026
6 checks passed
@GizzZmo
GizzZmo deleted the copilot/fix-cyberpunk-look-and-feel-error branch April 25, 2026 17:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes usage of the non-existent juce::Graphics::getCurrentColour() API (JUCE 7.0.9) by computing the intended text colour locally before setting it, resolving a macOS compile error.

Changes:

  • Replace getCurrentColour().brighter(...) with a local textColour variable that is optionally brightened.
  • Consolidate text colour selection into a single g.setColour(...) call.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CyberpunkLookAndFeel.h
Comment on lines +196 to +197
textColour = textColour.brighter (0.2f);
g.setColour (textColour);

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spacing around parentheses is inconsistent with the surrounding method calls in this file (e.g., g.setColour(matrixGreen) / textColour.brighter(…)). Consider removing the extra spaces in textColour.brighter (0.2f) and g.setColour (textColour) to match the local style and reduce diff noise.

Suggested change
textColour = textColour.brighter (0.2f);
g.setColour (textColour);
textColour = textColour.brighter(0.2f);
g.setColour(textColour);

Copilot uses AI. Check for mistakes.
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.

3 participants