Colors
in package
Colors stylesheet generator class.
Table of Contents
- EMPTY_COLOR = 'rgba(0,0,0,0.1)'
- activeModuleColor() : string
- Set module color active flag.
- addPicklistColorColumn() : mixed
- Function to add color column in picklist table.
- generate() : mixed
- Generate stylesheet file.
- generateFields() : mixed
- Generate fields colors stylesheet.
- get() : string
- Get normalized color or generate if empty.
- getAllFilterColors() : array<string|int, string>
- Get all filter colors.
- getAllGroupColor() : array<string|int, mixed>
- Get all group color.
- getAllModuleColor() : array<string|int, mixed>
- Get all module color.
- getAllUserColor() : array<string|int, mixed>
- Get all users colors.
- getContrast() : string
- Get contrast color.
- getPicklistFieldsByModule() : array<string|int, Vtiger_Field_Model>
- Function gives fields based on the module.
- getRandomColor() : string
- Get random color code.
- sanitizeValue() : string
- Sanitize value for use in css class name.
- updateFieldColor() : bool
- Update field color code and generate stylesheet file.
- updateGroupColor() : mixed
- Update group color code and generate stylesheet file.
- updateModuleColor() : mixed
- Function to update color for module.
- updatePicklistValueColor() : mixed
- Function to update color for picklist value.
- updateUserColor() : mixed
- Update user color code and generate stylesheet file.
- generateModules() : mixed
- Generate modules colors stylesheet.
- generateOwners() : mixed
- Generate owners colors stylesheet.
- generatePicklists() : mixed
- Generate picklists colors stylesheet.
Constants
EMPTY_COLOR
public
mixed
EMPTY_COLOR
= 'rgba(0,0,0,0.1)'
Methods
activeModuleColor()
Set module color active flag.
public
static activeModuleColor(int $id, bool $active, string $color) : string
Parameters
- $id : int
- $active : bool
- $color : string
Return values
string —addPicklistColorColumn()
Function to add color column in picklist table.
public
static addPicklistColorColumn(int $fieldId) : mixed
Parameters
- $fieldId : int
Return values
mixed —generate()
Generate stylesheet file.
public
static generate([string $type = 'all' ]) : mixed
Parameters
- $type : string = 'all'
-
type to generate, default all
Return values
mixed —generateFields()
Generate fields colors stylesheet.
public
static generateFields() : mixed
Return values
mixed —get()
Get normalized color or generate if empty.
public
static get(string $color, mixed $value) : string
Parameters
- $color : string
- $value : mixed
Return values
string —getAllFilterColors()
Get all filter colors.
public
static getAllFilterColors([mixed $byFilterValue = false ]) : array<string|int, string>
Parameters
- $byFilterValue : mixed = false
Return values
array<string|int, string> —getAllGroupColor()
Get all group color.
public
static getAllGroupColor() : array<string|int, mixed>
Return values
array<string|int, mixed> —getAllModuleColor()
Get all module color.
public
static getAllModuleColor([bool $active = false ]) : array<string|int, mixed>
Parameters
- $active : bool = false
Return values
array<string|int, mixed> —getAllUserColor()
Get all users colors.
public
static getAllUserColor() : array<string|int, mixed>
Return values
array<string|int, mixed> —getContrast()
Get contrast color.
public
static getContrast(mixed $hexColor) : string
Parameters
- $hexColor : mixed
Return values
string —getPicklistFieldsByModule()
Function gives fields based on the module.
public
static getPicklistFieldsByModule(string $moduleName) : array<string|int, Vtiger_Field_Model>
Parameters
- $moduleName : string
Return values
array<string|int, Vtiger_Field_Model> —- list of field models
getRandomColor()
Get random color code.
public
static getRandomColor([mixed $fromValue = false ]) : string
Parameters
- $fromValue : mixed = false
Return values
string —sanitizeValue()
Sanitize value for use in css class name.
public
static sanitizeValue(string $value) : string
Parameters
- $value : string
Return values
string —updateFieldColor()
Update field color code and generate stylesheet file.
public
static updateFieldColor(int $fieldId, string $color) : bool
Parameters
- $fieldId : int
- $color : string
Return values
bool —updateGroupColor()
Update group color code and generate stylesheet file.
public
static updateGroupColor(int $id, string $color) : mixed
Parameters
- $id : int
- $color : string
Return values
mixed —updateModuleColor()
Function to update color for module.
public
static updateModuleColor(mixed $id, mixed $color) : mixed
Parameters
- $id : mixed
- $color : mixed
Return values
mixed —updatePicklistValueColor()
Function to update color for picklist value.
public
static updatePicklistValueColor(int $picklistId, int $picklistValueId, string $color) : mixed
Parameters
- $picklistId : int
- $picklistValueId : int
- $color : string
Return values
mixed —updateUserColor()
Update user color code and generate stylesheet file.
public
static updateUserColor(int $id, string $color) : mixed
Parameters
- $id : int
- $color : string
Return values
mixed —generateModules()
Generate modules colors stylesheet.
private
static generateModules() : mixed
Return values
mixed —generateOwners()
Generate owners colors stylesheet.
private
static generateOwners() : mixed
Return values
mixed —generatePicklists()
Generate picklists colors stylesheet.
private
static generatePicklists() : mixed