# darkify/1.3.2/src/Admin/Views/ImageStyle.php

Darkify – Dark Mode &amp; Night Mode for Website &amp; Admin (Dark Theme Included), version 1.3.2. 244 lines.

- Page: https://pluginprobe.com/plugins/darkify/1.3.2/code/src/Admin/Views/ImageStyle.php
- Raw: https://pluginprobe.com/plugins/darkify/1.3.2/raw/src/Admin/Views/ImageStyle.php
- Modified: 2025-03-24T01:22:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/darkify/1.3.2/code/src/Admin/Views/ImageStyle.php#L10-L20`.

```php
<?php

/**
 * Views class for Shortcode generator options.
 *
 * @link       https://themeatelier.net
 * @since      1.0.0
 *
 * @package darkify
 * @subpackage darkify/src/Admin/Views/ImageStyle
 * @author     ThemeAtelier<themeatelierbd@gmail.com>
 */

namespace ThemeAtelier\Darkify\Admin\Views;

use ThemeAtelier\Darkify\Admin\Framework\Classes\Darkify;

class ImageStyle
{
  /**
   * Create Option fields for the setting options.
   *
   * @param string $prefix Option setting key prefix.
   * @return void
   */
  public static function options($prefix)
  {
    Darkify::createSection($prefix, array(
      'title'  => esc_html__('IMAGE STYLE', 'darkify'),
      'icon'   => 'icofont-image',
      'fields' => array(
        // Appearance Control
        array(
          'type'    => 'heading',
          'content' => esc_html__('Appearance Control', 'darkify'),
        ),

        // Low Brightness
        array(
          'id'     => 'brightness',
          'type'   => 'fieldset',
          'fields' => array(
            array(
              'id' => 'enable_low_image_brightness',
              'type'  => 'switcher',
              'title' => esc_html__('Low Brightness', 'darkify'),
              'desc'  => esc_html__('Switch and select the brightness level of images on dark mode.', 'darkify'),
              'text_on' => esc_html__('Yes', 'darkify'),
              'text_off' => esc_html__('No', 'darkify'),
              'default' => true,
            ),
            array(
              'id' => 'low_image_brightness_label',
              'type'  => 'select',
              'title' => esc_html__('Brightness Label', 'darkify'),
              'options' => array(
                '0' => esc_html__('0% Brightness', 'darkify'),
                '10' => esc_html__('10% Brightness', 'darkify'),
                '20' => esc_html__('20% Brightness', 'darkify'),
                '30' => esc_html__('30% Brightness', 'darkify'),
                '40' => esc_html__('40% Brightness', 'darkify'),
                '50' => esc_html__('50% Brightness', 'darkify'),
                '60' => esc_html__('60% Brightness', 'darkify'),
                '70' => esc_html__('70% Brightness', 'darkify'),
                '80' => esc_html__('80% Brightness', 'darkify'),
                '90' => esc_html__('90% Brightness', 'darkify'),
                '100' => esc_html__('100% Brightness', 'darkify'),
              ),
              'default'     => '80',
              'dependency' => array('enable_low_image_brightness', '==', 'true', 'all'),
            ),
            array(
              'id' => 'disallowed_low_brightness_images',
              'type'  => 'textarea',
              'title' => esc_html__('Allow Only Elements', 'darkify'),
              'desc'  => esc_html__('Enter comma-separated image URLs where brightness will be normal.', 'darkify'),
              'placeholder' => esc_html__('Exclude low brightness on specific images.', 'darkify'),
              'dependency' => array('enable_low_image_brightness', '==', 'true', 'all'),
              'class' => 'only_pro',
            ),
          ),
        ),
        // Grayscale Image
        array(
          'id'     => 'grayscale',
          'type'   => 'fieldset',
          'fields' => array(
            array(
              'id' => 'enable_image_grayscale',
              'type'  => 'switcher',
              'title' => esc_html__('Grayscale Image', 'darkify'),
              'desc'  => esc_html__('Switch and select the grayscale level of images on dark mode.', 'darkify'),
              'text_on' => esc_html__('Yes', 'darkify'),
              'text_off' => esc_html__('No', 'darkify'),
              'default' => false,
            ),
            array(
              'id' => 'image_grayscale_label',
              'type'  => 'select',
              'title' => esc_html__('Grayscale Label', 'darkify'),
              'options' => array(
                '0' => esc_html__('0% Brightness', 'darkify'),
                '10' => esc_html__('10% Grayscale', 'darkify'),
                '20' => esc_html__('20% Grayscale', 'darkify'),
                '30' => esc_html__('30% Grayscale', 'darkify'),
                '40' => esc_html__('40% Grayscale', 'darkify'),
                '50' => esc_html__('50% Grayscale', 'darkify'),
                '60' => esc_html__('60% Grayscale', 'darkify'),
                '70' => esc_html__('70% Grayscale', 'darkify'),
                '80' => esc_html__('80% Grayscale', 'darkify'),
                '90' => esc_html__('90% Grayscale', 'darkify'),
                '100' => esc_html__('100% Grayscale', 'darkify'),
              ),
              'default'     => '80',
              'dependency' => array('enable_image_grayscale', '==', 'true', 'all'),
            ),

            array(
              'id' => 'disallowed_low_grayscale_images',
              'type'  => 'textarea',
              'title' => esc_html__('Exclude images', 'darkify'),
              'desc'  => esc_html__('Enter comma-separated image URLs where grayscale will be normal.', 'darkify'),
              'placeholder' => esc_html__('Exclude low grayscale on specific images.', 'darkify'),
              'dependency' => array('enable_image_grayscale', '==', 'true', 'all'),
              'class' => 'only_pro',
            ),
          ),
        ),

        // Darken Background Image
        array(
          'id'     => 'darken_background',
          'type'   => 'fieldset',
          'fields' => array(
            array(
              'id' => 'enable_low_image_darken',
              'type'  => 'switcher',
              'title' => esc_html__('Darken Background Image', 'darkify'),
              'desc'  => esc_html__('Switch and select the level of darkness of background images on dark mode.', 'darkify'),
              'text_on' => esc_html__('Yes', 'darkify'),
              'text_off' => esc_html__('No', 'darkify'),
              'default' => true,
            ),
            array(
              'id' => 'low_image_darken_label',
              'type'  => 'select',
              'title' => esc_html__('Darken Label', 'darkify'),
              'options' => array(
                '0' => esc_html__('0% Darken', 'darkify'),
                '10' => esc_html__('10% Darken', 'darkify'),
                '20' => esc_html__('20% Darken', 'darkify'),
                '30' => esc_html__('30% Darken', 'darkify'),
                '40' => esc_html__('40% Darken', 'darkify'),
                '50' => esc_html__('50% Darken', 'darkify'),
                '60' => esc_html__('60% Darken', 'darkify'),
                '70' => esc_html__('70% Darken', 'darkify'),
                '80' => esc_html__('80% Darken', 'darkify'),
                '90' => esc_html__('90% Darken', 'darkify'),
                '100' => esc_html__('100% Darken', 'darkify'),
              ),
              'default'     => '80',
              'dependency' => array('enable_low_image_darken', '==', 'true', 'all'),
            ),
          ),
        ),

        array(
          'id' => 'enable_invert_inline_svg',
          'type'  => 'switcher',
          'title' => esc_html__('Invert Inline SVG', 'darkify'),
          'desc'  => esc_html__('Turn On to automatically invert all inline SVG images in dark mode.', 'darkify'),
          'default' => false,
        ),
        // Image Inversion
        array(
          'id'     => 'invert',
          'type'   => 'fieldset',
          'class' => 'only_pro',
          'fields' => array(
            array(
              'id' => 'enable_invert_images',
              'type'  => 'switcher',
              'class' => 'switcher_pro_only',
              'title' => esc_html__('Invert speceifc Images', 'darkify'),
              'desc'  => esc_html__('Switch to invert specific images on dark mode.', 'darkify'),
              'text_on' => esc_html__('Yes', 'darkify'),
              'text_off' => esc_html__('No', 'darkify'),
              'default' => false,
            ),
            array(
              'id' => 'invert_images_allowed_urls',
              'type'  => 'textarea',
              'title' => esc_html__('Image URLs', 'darkify'),
              'desc'  => esc_html__('Image "src", "srcset" or CSS backgroundImage URLs are supported to target for inversion.', 'darkify'),
              'placeholder' => esc_html__('Enter comma-separated image URLs where inversion needed to apply.', 'darkify'),
              // 'dependency' => array('enable_invert_images', '==', 'true', 'all'),
            ),
          ),
        ),
        // Image Replacement
        array(
          'type'    => 'heading',
          'content' => esc_html__('Image Replacement', 'darkify'),
        ),

        array(
          'id'        => 'image_replacements',
          'type'      => 'repeater',
          'class' => 'repeater_pro_only',
          'title'     => esc_html__('Replace images', 'darkify'),
          'fields'    => array(
            array(
              'id'           => 'normal_image',
              'type'         => 'upload',
              'title'        => esc_html__('Normal Mode Image', 'darkify'),
              'library'      => 'image',
              'placeholder'  => esc_html__('Image URL', 'darkify'),
              'button_title' => esc_html__('Add Image', 'darkify'),
              'remove_title' => esc_html__('Remove Image', 'darkify'),
            ),

            array(
              'id'           => 'dark_image',
              'type'         => 'upload',
              'title'        => esc_html__('Dark Mode Image', 'darkify'),
              'library'      => 'image',
              'placeholder'  =>   esc_html__('Image URL', 'darkify'),
              'button_title' => esc_html__('Add Image', 'darkify'),
              'remove_title' => esc_html__('Remove Image', 'darkify'),
            ),

          ),
          'default'   => array(
            array(
              'normal_image' => '',
              'dark_image' => '',
            ),
          )
        ),
      )
    ));
  }
}

```
