Skip to content

Ring light on macOs. If you don't have the latest MacOs and feeling like needing or trying out the edge light feature here it is. It is a virtual ring light that you can use on macOs.

Notifications You must be signed in to change notification settings

theBstar/ring-light

Repository files navigation

Ring Light for macOS

Ring Light Hero

A professional, customizable ring light overlay application for macOS. Designed to provide better lighting for video calls, streaming, and content creation by turning your screen edges into a soft, adjustable light source.

Visual Showcase

Multiple Positions Premium Control Panel
Positioning Showcase Control Panel UI

Features

  • Solid Core Ring Light: 70% solid core / 30% blur radius for a realistic, professional light source look.
  • Customizable Appearance:
    • Adjust Opacity (0-100%)
    • Adjust Ring Width (50-300px)
    • Color Picker with 11 presets
  • System Brightness Control: Integrated slider to control your Mac's actual screen brightness.
  • Always On Top: The overlay stays above all other windows but lets you click through it.
  • Smart Controls:
    • Floating control panel.
    • Quick "Hide" to Dock.
    • Keyboard Shortcuts.

Keyboard Shortcuts

  • Cmd + L: Toggle Control Panel (Show/Hide)
  • Cmd + E: Quit Application
  • Esc: Quit Application

How to Run Locally

Prerequisites

  • macOS 12.0 or later
  • Xcode or Swift command line tools installed (xcode-select --install)

Create the App Bundle (Easiest)

Simply run the included build script to generate a double-clickable .app file:

chmod +x build_app.sh
./build_app.sh

This will create RingLight.app in the project root. You can move this to your /Applications folder.

Troubleshooting (First Time Launch)

Since this app is not distributed via the App Store, macOS may show a warning: "RingLight can’t be opened because it is from an unidentified developer."

To fix this:

  1. Right-click (or Control-click) RingLight.app.
  2. Select Open from the menu.
  3. Click Open again in the confirmation dialog.
  4. The app will now run normally every time!

Native Build (Alternative)

  1. Build the application (Release mode):
    swift build --product RingLight -c release
  2. Run the executable:
    .build/release/RingLight

Permissions

The application requires Accessibility Permissions to control system brightness (it simulates brightness key presses). When prompted, allow the app in System Settings > Privacy & Security > Accessibility.

Technical Architecture

The application is built natively using Swift and SwiftUI, avoiding heavy frameworks like Electron for the final build to ensure high performance and low battery usage.

Core Components

  1. Entry Point (RingLightApp.swift):

    • Uses NSApplicationDelegate lifecycle.
    • Sets the app as an "Accessory" app (default) or "Regular" app (when docked) dynamically.
    • Manages the two main windows: The Overlay and the Control Panel.
  2. Overlay Engine (OverlayWindow.swift & RingLightOverlay.swift):

    • Transparent Window: A custom NSWindow subclass that is full-screen, transparent, and acts as an overlay.
    • Click-Through: The window ignores mouse events (ignoresMouseEvents = true), allowing you to work underneath the light.
    • Layered Rendering: Uses SwiftUI ZStack to render:
      • Layer 1 (Glow): A wide, blurred stroke for ambient light falloff.
      • Layer 2 (Core): A solid, slightly blurred stroke for the main light body.
  3. Control System (ControlPanel.swift & ControlPanelView.swift):

    • A floating NSPanel that stays active even when other apps are focused.
    • Uses RingLightService (ObservableObject) to reactively update the overlay state.
    • Brightness Control: BrightnessService uses CGEvent to simulate native brightness key presses (F14/F15), ensuring compatibility with all Apple and most external displays without needing complex DDC/CI hardware control.
  4. Input Handling:

    • NSEvent.addLocalMonitorForEvents handles global-style shortcuts when the control panel is focused.

Built with ❤️ using Swift.

About

Ring light on macOs. If you don't have the latest MacOs and feeling like needing or trying out the edge light feature here it is. It is a virtual ring light that you can use on macOs.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published