Model

Color Model class

Namespace: Com\Tecnick\Color

Implements: Template

Abstract: Yes

File: Model.php line 36

Color Model class

Tags

Methods

create()

File: Model.php line 76

public static create(ColorModelType|string $type[, array<string, int|float|string> $components = [] ]) : self

Parameters

  • $type : ColorModelType|string: Color model type.
  • $components : array<string, int|float|string> = []: Color components.

Tags

Return values

self

getHexValue()

File: Model.php line 401

public getHexValue(float $value, int $max) : string

The result is zero-padded to 2 digits.

Parameters

  • $value : float: Fraction value to convert [0..1]
  • $max : int: Maximum value to return (reference value) [0..255]

Return values

string

getNormalizedValue()

File: Model.php line 361

public getNormalizedValue(float $value, int $max) : float

Parameters

  • $value : float: Fraction value to convert [0..1]
  • $max : int: Maximum value to return (reference value)

Return values

float —

value [0..$max]

getRgbaHexColor()

File: Model.php line 409

public getRgbaHexColor() : string

Return values

string

getRgbHexColor()

File: Model.php line 434

public getRgbHexColor() : string

Return values

string

getType()

File: Model.php line 338

public getType() : string

Return values

string

getTypeEnum()

File: Model.php line 348

public getTypeEnum() : ColorModelType

Tags

  • throws: Exception if the model declares an unknown type

Return values

ColorModelType

withInvertedColor()

File: Model.php line 426

public withInvertedColor() : static

The receiver is left untouched, unlike invertColor().

Return values

static