Skip to content

Add saturation adjustment property to VisualEffectView - #58

Merged
efremidze merged 5 commits into
masterfrom
copilot/fix-55
Aug 29, 2025
Merged

Add saturation adjustment property to VisualEffectView#58
efremidze merged 5 commits into
masterfrom
copilot/fix-55

Conversation

Copilot AI commented Aug 28, 2025

Copy link
Copy Markdown
Contributor

This PR adds saturation control to VisualEffectView, enabling Figma-style blur effects with color saturation adjustment.

New Features

UIKit API

let visualEffectView = VisualEffectView()
visualEffectView.blurRadius = 10
visualEffectView.saturation = 1.5  // 50% more saturated colors

SwiftUI API

VisualEffect(
    colorTint: .blue,
    colorTintAlpha: 0.3,
    blurRadius: 12,
    saturation: 1.8  // Vibrant colors
)

Implementation Details

  • Property: Added saturation: CGFloat property with default value 1.0
  • Underlying Implementation: Uses the existing saturationDeltaFactor key from the private blur effect API
  • Value Range:
    • 0.0 = completely grayscale
    • 1.0 = original saturation (default)
    • > 1.0 = increased saturation (more vibrant)
  • Pattern: Follows the same implementation pattern as existing properties like scale and blurRadius

Example App Updates

The example app now includes dual sliders to demonstrate both blur and saturation effects:

  • Blur radius control (0-20)
  • Saturation control (0-3)
  • Real-time preview showing the combined effects

Usage Examples

// Subtle enhancement
visualEffectView.saturation = 1.2

// Muted background effect
visualEffectView.saturation = 0.6

// Artistic grayscale blur
visualEffectView.saturation = 0.0
visualEffectView.blurRadius = 15

The implementation maintains full backward compatibility and follows the established API patterns.

Fixes #55.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI commented Aug 28, 2025

Copy link
Copy Markdown
Contributor Author

@efremidze 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Co-authored-by: efremidze <2286277+efremidze@users.noreply.github.com>
Copilot AI changed the title [WIP] how to adjust saturation Add saturation adjustment property to VisualEffectView Aug 28, 2025
Copilot AI requested a review from efremidze August 28, 2025 07:52
@coderabbitai

coderabbitai Bot commented Aug 29, 2025

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbit review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Join our Discord community for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@efremidze
efremidze marked this pull request as ready for review August 29, 2025 02:36
@efremidze
efremidze merged commit 7e3918b into master Aug 29, 2025
3 checks passed
@efremidze
efremidze deleted the copilot/fix-55 branch August 29, 2025 02:37
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.

how to adjust saturation

2 participants