Ask AI
Skip to main content

Switch light/dark mode

Function: Switch light/dark mode​

This action allows you to instantly change the visual theme of your application between a light mode and a dark mode. It's perfect for adapting the app's appearance to user preferences or ambient lighting conditions, providing a more comfortable viewing experience.

Input​

This function does not require any direct inputs. It simply toggles the current theme of your application.

Output​

This function does not produce any direct data outputs. Its effect is a visual change to the application's interface.

Execution Flow​

Real-Life Examples​

Here are some practical ways you can use the "Switch light/dark mode" action in your application:

  1. User Preference Toggle

    • Inputs: None
    • Result: A user clicks a "Dark Mode" button in their profile settings or a quick-access toolbar. The entire application immediately switches from a bright, light theme to a darker, more subdued theme, reflecting their personal preference.
  2. Time-Based Theme Change

    • Inputs: None
    • Result: You set up an automated rule to trigger this action at sunset (e.g., 6 PM local time). As the evening begins, the application automatically transitions from its light theme to a dark theme, making it easier on the eyes during low-light conditions.
  3. Accessibility Option

    • Inputs: None
    • Result: A user with visual sensitivity selects an option in the app's accessibility menu to "Enable Dark Mode." This action is triggered, and the application's interface changes to a high-contrast dark mode, improving readability and reducing eye strain for them.