PHP code example of ruslanshigabutdinov / nativephp-color-scheme
1. Go to this page and download the library: Download ruslanshigabutdinov/nativephp-color-scheme library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ruslanshigabutdinov / nativephp-color-scheme example snippets
use RuslanShigabutdinov\NativeColorScheme\Facades\NativeColorScheme;
NativeColorScheme::getPreference(); // system, light, dark, or null
NativeColorScheme::getColorScheme(); // effective light, dark, or null
NativeColorScheme::isSystem();
NativeColorScheme::isDark();
NativeColorScheme::isLight();
NativeColorScheme::useSystem();
NativeColorScheme::useLight();
NativeColorScheme::useDark();
NativeColorScheme::setPreference('system');
NativeColorScheme::setPreference('light');
NativeColorScheme::setPreference('dark');
NativeColorScheme::setPreference('auto');
NativeColorScheme::state();
// [
// 'preference' => 'system',
// 'colorScheme' => 'dark',
// 'systemColorScheme' => 'dark',
// 'isSystem' => true,
// 'isDark' => true,
// 'isLight' => false,
// ]
bash
php artisan native:plugin:register ruslanshigabutdinov/nativephp-color-scheme
bash
php artisan vendor:publish --tag=nativephp-plugins-provider
bash
php artisan native:run
bash
php artisan native:install --force
php artisan native:run