Theme
in package
Table of Contents
Properties
- $dark_mode : mixed
- $theme_base : mixed
Methods
- defaults() : mixed
- Get default theme values from a configured theme or the actual defaults
- deriveTsugiColors() : mixed
- Derive a range of named colors from a single base color
- findLMidPointForHue() : mixed
- Take a color and move it along its luminance until it is halfway between a given dark color and white
- getLegacyTheme() : mixed
- hslToRgb() : mixed
- isActive() : mixed
- luminosityPair() : mixed
- Take a color, move a pair of colors outwards towards white and black until the colors are at least as far apart as $difference
- rgbToHsl() : mixed
- adjustBrightness() : string
- From https://stackoverflow.com/questions/3512311/how-to-generate-lighter-darker-color-with-php
Properties
$dark_mode
public
static mixed
$dark_mode
= false
$theme_base
public
static mixed
$theme_base
= null
Methods
defaults()
Get default theme values from a configured theme or the actual defaults
public
static defaults([mixed $theme = false ]) : mixed
Parameters
- $theme : mixed = false
deriveTsugiColors()
Derive a range of named colors from a single base color
public
static deriveTsugiColors(mixed $tsugi_dark) : mixed
This color should have at least an 8.0 luminance ratio from white - if not - it will be moved to the point where it does have an 8.0 luminance ratio from white.
Parameters
- $tsugi_dark : mixed
findLMidPointForHue()
Take a color and move it along its luminance until it is halfway between a given dark color and white
public
static findLMidPointForHue(mixed $r[, mixed $g = false ][, mixed $b = false ][, mixed $dark = false ]) : mixed
Parameters
- $r : mixed
- $g : mixed = false
- $b : mixed = false
- $dark : mixed = false
getLegacyTheme()
public
static getLegacyTheme(mixed $tsugi_dark, mixed $dark_mode) : mixed
Parameters
- $tsugi_dark : mixed
- $dark_mode : mixed
hslToRgb()
public
static hslToRgb(mixed $h[, mixed $s = false ][, mixed $l = false ]) : mixed
Parameters
- $h : mixed
- $s : mixed = false
- $l : mixed = false
isActive()
public
static isActive([mixed $themeIndicator = false ]) : mixed
Parameters
- $themeIndicator : mixed = false
luminosityPair()
Take a color, move a pair of colors outwards towards white and black until the colors are at least as far apart as $difference
public
static luminosityPair(mixed $difference, mixed $r[, mixed $g = false ][, mixed $b = false ]) : mixed
Parameters
- $difference : mixed
- $r : mixed
- $g : mixed = false
- $b : mixed = false
rgbToHsl()
public
static rgbToHsl(mixed $r[, mixed $g = false ][, mixed $b = false ]) : mixed
Parameters
- $r : mixed
- $g : mixed = false
- $b : mixed = false
adjustBrightness()
From https://stackoverflow.com/questions/3512311/how-to-generate-lighter-darker-color-with-php
private
static adjustBrightness(string $hexCode, float $adjustPercent) : string
Increases or decreases the brightness of a color by a percentage of the current brightness.
Parameters
- $hexCode : string
-
Supported formats:
#FFF,#FFFFFF,FFF,FFFFFF - $adjustPercent : float
-
A number between -1 and 1. E.g. 0.3 = 30% lighter; -0.4 = 40% darker.