CSSkinNeutral
extends CSSkinWrapper
in package
Abstract class to serve as a base structure for multiple CSSkin's classes
Tags
Table of Contents
- COLOR_PRIMARY = 'ColorPrimary'
- The variants of the Brand colors.
- COLOR_PRIMARY_DEFAULT = '#221F61'
- COLOR_PRIMARY_DEFERRED = 'ColorPrimaryDeferred'
- COLOR_PRIMARY_DEFERRED_FOREGROUND = 'ColorPrimaryDeferredForeground'
- COLOR_PRIMARY_FOREGROUND = 'ColorPrimaryForeground'
- COLOR_PRIMARY_HOVER = 'ColorPrimaryHover'
- COLOR_PRIMARY_HOVER_FOREGROUND = 'ColorPrimaryHoverForeground'
- COLOR_PRIMARY_TYPE_DEFERRED = 1
- COLOR_PRIMARY_TYPE_HOVER = 2
- COLOR_PRIMARY_TYPE_MAIN = 0
- The Type constants to specify what variant of primary color to retrieve
- COLOR_SECONDARY = 'ColorSecondary'
- COLOR_SECONDARY_DEFAULT = '#fe0074'
- COLOR_SECONDARY_DISABLED = 'ColorSecondaryDisabled'
- COLOR_SECONDARY_DISABLED_FOREGROUND = 'ColorSecondaryDisabledForeground'
- COLOR_SECONDARY_FOREGROUND = 'ColorSecondaryForeground'
- COLOR_SECONDARY_HOVER = 'ColorSecondaryHover'
- COLOR_SECONDARY_HOVER_FOREGROUND = 'ColorSecondaryHoverForeground'
- COLOR_SECONDARY_TYPE_DISABLED = 1
- COLOR_SECONDARY_TYPE_HOVER = 2
- COLOR_SECONDARY_TYPE_MAIN = 0
- The Type constants to specify what variant of secondary color to retrieve
- COLOR_SHADOW_TYPE_MEDIUM = 1
- COLOR_SHADOW_TYPE_SOFT = 0
- The Type constants to specify what variant of shadow color to retrieve
- COLOR_SHADOW_TYPE_STRONG = 2
- LOGO_TYPE_LARGE = 0
- Logo types
- LOGO_TYPE_SMALL = 1
- SHADOW_BASE_COLOR = '#191D23'
- The variants of the shadow colors, which are dynamically calculated from the base color
- SHADOW_BASE_COLOR_MEDIUM = 'ShadowBaseColorMedium'
- SHADOW_BASE_COLOR_SOFT = 'ShadowBaseColorSoft'
- SHADOW_BASE_COLOR_STRONG = 'ShadowBaseColorStrong'
- STATUS_BLUE = 'StatusBlue'
- STATUS_BLUE_DISABLED = 'StatusBlueDisabled'
- STATUS_BLUE_HOVER = 'StatusBlueHover'
- STATUS_GREEN = 'StatusGreen'
- The variants of the status colors.
- STATUS_GREEN_DISABLED = 'StatusGreenDisabled'
- STATUS_GREEN_HOVER = 'StatusGreenHover'
- STATUS_ORANGE = 'StatusOrange'
- STATUS_ORANGE_DISABLED = 'StatusOrangeDisabled'
- STATUS_ORANGE_HOVER = 'StatusOrangeHover'
- STATUS_RED = 'StatusRed'
- STATUS_RED_DISABLED = 'StatusRedDisabled'
- STATUS_RED_HOVER = 'StatusRedHover'
- SYSTEM_FILL_10 = 'SystemFill10'
- The variants of the system fill colors, they're complementary neutral colors
- SYSTEM_FILL_20 = 'SystemFill20'
- SYSTEM_FILL_35 = 'SystemFill35'
- SYSTEM_FILL_70 = 'SystemFill70'
- SYSTEM_FILL_D0 = 'SystemFillD0'
- SYSTEM_FILL_FF = 'SystemFillFF'
- SYSTEM_PRIMARY_BACKGROUND = 'SystemPrimaryBackground'
- The variants of the system background colors
- SYSTEM_PRIMARY_FOREGROUND = 'SystemPrimaryForeground'
- The variants of the system label/foreground colors.
- SYSTEM_SECONDARY_BACKGROUND = 'SystemSecondaryBackground'
- SYSTEM_SECONDARY_FOREGROUND = 'SystemSecondaryForeground'
- SYSTEM_TERTIARY_BACKGROUND = 'SystemTertiaryBackground'
- addTransparencyToHexColor() : string
- Adds the transparency part of the hex color based on a percentage. It will also overwrite already defined alpha channel in the color code.
- createCSSFiles() : mixed
- Creates all CSS files required
- getApplicationLogoForType() : string
- Returns the URL to the configured or standard application SVG logo.
- getColor() : mixed|null
- Get a specific color based in a given token
- getColorForBackgroundColor() : the
- Returns a foreground color recommended in front of a given background color
- getColorPrimary() : string
- Returns the color value of the primary brand color.
- getColorPrimaryForeground() : string
- Returns the color value of the primary brand foreground color.
- getColors() : array<string|int, mixed>
- Get all the colors defined
- getColorSecondary() : string
- Returns the color value of the secondary brand color.
- getColorSecondaryForeground() : string
- Returns the color value of the secondary brand foreground color.
- getHexColorFromBrightness() : string
- Calculates a new hex color based on a level of brightness
- getLuminance() : float
- This algorithm is taken from a formula for converting RGB values to YIQ values.
- getOptionNames() : string
- Tells which option names are available
- getParam() : string
- Returns a specific parameter value by name
- getParamNames() : array<string|int, mixed>
- Returns which parameter names are available
- getShadowColor() : string
- Returns the color value of a shadow variant
- getStandardLuminance() : float
- Calculates the relative luminance which is the Standard way to calculate luminance
- getStylesheetLink() : string
- isBrightColor() : bool
- Tells if a color is bright against a dark background
- isDarkColor() : bool
- Tells if a color is dark against a white background
- parseColorParameter() : mixed|null
Constants
COLOR_PRIMARY
The variants of the Brand colors.
public
string
COLOR_PRIMARY
= 'ColorPrimary'
All brand colors are calculated from the primary or secondary base color
Tags
COLOR_PRIMARY_DEFAULT
public
mixed
COLOR_PRIMARY_DEFAULT
= '#221F61'
Tags
COLOR_PRIMARY_DEFERRED
public
mixed
COLOR_PRIMARY_DEFERRED
= 'ColorPrimaryDeferred'
Tags
COLOR_PRIMARY_DEFERRED_FOREGROUND
public
mixed
COLOR_PRIMARY_DEFERRED_FOREGROUND
= 'ColorPrimaryDeferredForeground'
Tags
COLOR_PRIMARY_FOREGROUND
public
mixed
COLOR_PRIMARY_FOREGROUND
= 'ColorPrimaryForeground'
Tags
COLOR_PRIMARY_HOVER
public
mixed
COLOR_PRIMARY_HOVER
= 'ColorPrimaryHover'
Tags
COLOR_PRIMARY_HOVER_FOREGROUND
public
mixed
COLOR_PRIMARY_HOVER_FOREGROUND
= 'ColorPrimaryHoverForeground'
Tags
COLOR_PRIMARY_TYPE_DEFERRED
public
mixed
COLOR_PRIMARY_TYPE_DEFERRED
= 1
Tags
COLOR_PRIMARY_TYPE_HOVER
public
mixed
COLOR_PRIMARY_TYPE_HOVER
= 2
Tags
COLOR_PRIMARY_TYPE_MAIN
The Type constants to specify what variant of primary color to retrieve
public
int
COLOR_PRIMARY_TYPE_MAIN
= 0
Tags
COLOR_SECONDARY
public
mixed
COLOR_SECONDARY
= 'ColorSecondary'
Tags
COLOR_SECONDARY_DEFAULT
public
mixed
COLOR_SECONDARY_DEFAULT
= '#fe0074'
Tags
COLOR_SECONDARY_DISABLED
public
mixed
COLOR_SECONDARY_DISABLED
= 'ColorSecondaryDisabled'
Tags
COLOR_SECONDARY_DISABLED_FOREGROUND
public
mixed
COLOR_SECONDARY_DISABLED_FOREGROUND
= 'ColorSecondaryDisabledForeground'
Tags
COLOR_SECONDARY_FOREGROUND
public
mixed
COLOR_SECONDARY_FOREGROUND
= 'ColorSecondaryForeground'
Tags
COLOR_SECONDARY_HOVER
public
mixed
COLOR_SECONDARY_HOVER
= 'ColorSecondaryHover'
Tags
COLOR_SECONDARY_HOVER_FOREGROUND
public
mixed
COLOR_SECONDARY_HOVER_FOREGROUND
= 'ColorSecondaryHoverForeground'
Tags
COLOR_SECONDARY_TYPE_DISABLED
public
mixed
COLOR_SECONDARY_TYPE_DISABLED
= 1
Tags
COLOR_SECONDARY_TYPE_HOVER
public
mixed
COLOR_SECONDARY_TYPE_HOVER
= 2
Tags
COLOR_SECONDARY_TYPE_MAIN
The Type constants to specify what variant of secondary color to retrieve
public
int
COLOR_SECONDARY_TYPE_MAIN
= 0
Tags
COLOR_SHADOW_TYPE_MEDIUM
public
mixed
COLOR_SHADOW_TYPE_MEDIUM
= 1
Tags
COLOR_SHADOW_TYPE_SOFT
The Type constants to specify what variant of shadow color to retrieve
public
int
COLOR_SHADOW_TYPE_SOFT
= 0
Tags
COLOR_SHADOW_TYPE_STRONG
public
mixed
COLOR_SHADOW_TYPE_STRONG
= 2
Tags
LOGO_TYPE_LARGE
Logo types
public
int
LOGO_TYPE_LARGE
= 0
Tags
LOGO_TYPE_SMALL
public
mixed
LOGO_TYPE_SMALL
= 1
Tags
SHADOW_BASE_COLOR
The variants of the shadow colors, which are dynamically calculated from the base color
public
string
SHADOW_BASE_COLOR
= '#191D23'
Tags
SHADOW_BASE_COLOR_MEDIUM
public
mixed
SHADOW_BASE_COLOR_MEDIUM
= 'ShadowBaseColorMedium'
Tags
SHADOW_BASE_COLOR_SOFT
public
mixed
SHADOW_BASE_COLOR_SOFT
= 'ShadowBaseColorSoft'
Tags
SHADOW_BASE_COLOR_STRONG
public
mixed
SHADOW_BASE_COLOR_STRONG
= 'ShadowBaseColorStrong'
Tags
STATUS_BLUE
public
mixed
STATUS_BLUE
= 'StatusBlue'
Tags
STATUS_BLUE_DISABLED
public
mixed
STATUS_BLUE_DISABLED
= 'StatusBlueDisabled'
Tags
STATUS_BLUE_HOVER
public
mixed
STATUS_BLUE_HOVER
= 'StatusBlueHover'
Tags
STATUS_GREEN
The variants of the status colors.
public
string
STATUS_GREEN
= 'StatusGreen'
Tags
STATUS_GREEN_DISABLED
public
mixed
STATUS_GREEN_DISABLED
= 'StatusGreenDisabled'
Tags
STATUS_GREEN_HOVER
public
mixed
STATUS_GREEN_HOVER
= 'StatusGreenHover'
Tags
STATUS_ORANGE
public
mixed
STATUS_ORANGE
= 'StatusOrange'
Tags
STATUS_ORANGE_DISABLED
public
mixed
STATUS_ORANGE_DISABLED
= 'StatusOrangeDisabled'
Tags
STATUS_ORANGE_HOVER
public
mixed
STATUS_ORANGE_HOVER
= 'StatusOrangeHover'
Tags
STATUS_RED
public
mixed
STATUS_RED
= 'StatusRed'
Tags
STATUS_RED_DISABLED
public
mixed
STATUS_RED_DISABLED
= 'StatusRedDisabled'
Tags
STATUS_RED_HOVER
public
mixed
STATUS_RED_HOVER
= 'StatusRedHover'
Tags
SYSTEM_FILL_10
The variants of the system fill colors, they're complementary neutral colors
public
string
SYSTEM_FILL_10
= 'SystemFill10'
Tags
SYSTEM_FILL_20
public
mixed
SYSTEM_FILL_20
= 'SystemFill20'
Tags
SYSTEM_FILL_35
public
mixed
SYSTEM_FILL_35
= 'SystemFill35'
Tags
SYSTEM_FILL_70
public
mixed
SYSTEM_FILL_70
= 'SystemFill70'
Tags
SYSTEM_FILL_D0
public
mixed
SYSTEM_FILL_D0
= 'SystemFillD0'
Tags
SYSTEM_FILL_FF
public
mixed
SYSTEM_FILL_FF
= 'SystemFillFF'
Tags
SYSTEM_PRIMARY_BACKGROUND
The variants of the system background colors
public
string
SYSTEM_PRIMARY_BACKGROUND
= 'SystemPrimaryBackground'
Tags
SYSTEM_PRIMARY_FOREGROUND
The variants of the system label/foreground colors.
public
string
SYSTEM_PRIMARY_FOREGROUND
= 'SystemPrimaryForeground'
Tags
SYSTEM_SECONDARY_BACKGROUND
public
mixed
SYSTEM_SECONDARY_BACKGROUND
= 'SystemSecondaryBackground'
Tags
SYSTEM_SECONDARY_FOREGROUND
public
mixed
SYSTEM_SECONDARY_FOREGROUND
= 'SystemSecondaryForeground'
Tags
SYSTEM_TERTIARY_BACKGROUND
public
mixed
SYSTEM_TERTIARY_BACKGROUND
= 'SystemTertiaryBackground'
Tags
Methods
addTransparencyToHexColor()
Adds the transparency part of the hex color based on a percentage. It will also overwrite already defined alpha channel in the color code.
public
static addTransparencyToHexColor(string $sHexColor, float $fPercent) : string
Parameters
- $sHexColor : string
-
the hex code color definition
- $fPercent : float
-
the percentage of transparency to add to the color, if negative makes it darker, if positive makes it brighter, value between 0 and 1
Tags
Return values
string —the 8 digit hex color, being the last 2 digits the alpha channel
createCSSFiles()
Creates all CSS files required
public
static createCSSFiles(int $iThemeId) : mixed
Parameters
- $iThemeId : int
Tags
Return values
mixed —getApplicationLogoForType()
Returns the URL to the configured or standard application SVG logo.
public
static getApplicationLogoForType([int $iType = self::LOGO_TYPE_LARGE ][, string $sBackgroundColor = '' ]) : string
If a HEX background color is given the standard application SVG logo will be returned with a contrast color.
Parameters
- $iType : int = self::LOGO_TYPE_LARGE
-
The size type of the application logo. Please use the available logo type constants: LOGO_TYPE_*
- $sBackgroundColor : string = ''
-
The HEX background color to return the logo with the most contrast for the given background color.
Tags
Return values
string —getColor()
Get a specific color based in a given token
public
final static getColor(mixed $sToken[, mixed $sDefault = '' ]) : mixed|null
Parameters
- $sToken : mixed
-
string The token corresponding the color to be retrieved
- $sDefault : mixed = ''
-
string The color to default to
Tags
Return values
mixed|null —getColorForBackgroundColor()
Returns a foreground color recommended in front of a given background color
public
static getColorForBackgroundColor([mixed $sBackgroundColor = '#FFFFFF' ]) : the
Parameters
- $sBackgroundColor : mixed = '#FFFFFF'
-
the foreground color
Tags
Return values
the —recommended foreground color
getColorPrimary()
Returns the color value of the primary brand color.
public
final static getColorPrimary([int $iType = self::COLOR_PRIMARY_TYPE_MAIN ]) : string
Parameters
- $iType : int = self::COLOR_PRIMARY_TYPE_MAIN
-
The type variant to retrieve
Tags
Return values
string —getColorPrimaryForeground()
Returns the color value of the primary brand foreground color.
public
final static getColorPrimaryForeground([int $iType = self::COLOR_PRIMARY_TYPE_MAIN ]) : string
Parameters
- $iType : int = self::COLOR_PRIMARY_TYPE_MAIN
-
The type variant to retrieve
Tags
Return values
string —getColors()
Get all the colors defined
public
final static getColors() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getColorSecondary()
Returns the color value of the secondary brand color.
public
final static getColorSecondary([int $iType = self::COLOR_SECONDARY_TYPE_MAIN ]) : string
Parameters
- $iType : int = self::COLOR_SECONDARY_TYPE_MAIN
-
The type variant to retrieve
Tags
Return values
string —getColorSecondaryForeground()
Returns the color value of the secondary brand foreground color.
public
final static getColorSecondaryForeground([int $iType = self::COLOR_SECONDARY_TYPE_MAIN ]) : string
Parameters
- $iType : int = self::COLOR_SECONDARY_TYPE_MAIN
-
The type variant to retrieve
Tags
Return values
string —getHexColorFromBrightness()
Calculates a new hex color based on a level of brightness
public
static getHexColorFromBrightness(string $sHexColor, float $fPercent) : string
Parameters
- $sHexColor : string
-
the hex code color definition
- $fPercent : float
-
the percentage of brightness to change the color, if negative makes it darker, if positive makes it brighter, value between 1 and -1
Tags
Return values
string —the calculated hex color
getLuminance()
This algorithm is taken from a formula for converting RGB values to YIQ values.
public
static getLuminance(string $sHexColor) : float
This gives a perceived luminance for a color.
Parameters
- $sHexColor : string
-
$sHexColor the color as 6/8 character hex code color definition, transparency is supported.
Tags
Return values
float —the perceived luminance
getOptionNames()
Tells which option names are available
public
final static getOptionNames() : string
Tags
Return values
string —getParam()
Returns a specific parameter value by name
public
final static getParam(string $sName) : string
Parameters
- $sName : string
-
The name of the parameter to request
Tags
Return values
string —The value from the requested parameter
getParamNames()
Returns which parameter names are available
public
final static getParamNames() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —An array with the parameter names available
getShadowColor()
Returns the color value of a shadow variant
public
final static getShadowColor([int $iType = self::COLOR_SHADOW_TYPE_SOFT ]) : string
Parameters
- $iType : int = self::COLOR_SHADOW_TYPE_SOFT
-
The type variant to retrieve
Tags
Return values
string —getStandardLuminance()
Calculates the relative luminance which is the Standard way to calculate luminance
public
static getStandardLuminance(string $sHexColor) : float
Parameters
- $sHexColor : string
-
$sHexColor the color as a 6/8 character hex code color definition, transparency is supported.
Tags
Return values
float —relative luminance
getStylesheetLink()
public
static getStylesheetLink() : string
Tags
Return values
string —returns a style sheet holding all Skin params
isBrightColor()
Tells if a color is bright against a dark background
public
static isBrightColor(string $sHexColor) : bool
Parameters
- $sHexColor : string
-
the color as 6 character hex code color definition, optional with leading #
Tags
Return values
bool —true if bright
isDarkColor()
Tells if a color is dark against a white background
public
static isDarkColor(string $sHexColor) : bool
Parameters
- $sHexColor : string
-
the color as 6 character hex code color definition, optional with leading #
Tags
Return values
bool —true if dark
parseColorParameter()
public
static parseColorParameter(mixed $sColor) : mixed|null
Parameters
- $sColor : mixed
-
string The color to retrieve
