classes-Com-Tecnick-Color-Model

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.

Model

Com\Tecnick\Color\Model

Color Model class

Tags
since
2015-02-21
category

Library

author

Nicola Asuni info@tecnick.com

copyright

2015-2015 Nicola Asuni - Tecnick.com LTD

license

http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)

link
https://github.com/tecnickcom/tc-lib-color

Table of Contents

$cmp_alpha  : float
Value of the Alpha channel component.
$type  : string
Color Model type (GRAY, RGB, HSL, CMYK)
__construct()  : mixed
Initialize a new color object
getHexValue()  : int
Get the normalized hexadecimal value of the specified float fraction
getNormalizedValue()  : int
Get the normalized integer value of the specified float fraction
getRgbaHexColor()  : string
Get the Hexadecimal representation of the color with alpha channel: #RRGGBBAA
getRgbHexColor()  : string
Get the Hexadecimal representation of the color: #RRGGBB
getType()  : string
Get the color model type (GRAY, RGB, HSL, CMYK)

Properties

$cmp_alpha

Value of the Alpha channel component.

protected float $cmp_alpha = 1.0

Values range between 0.0 (fully transparent) and 1.0 (fully opaque)

$type

Color Model type (GRAY, RGB, HSL, CMYK)

protected string $type

Methods

__construct()

Initialize a new color object

public __construct(array<string|int, mixed> $components) : mixed
Parameters
$components : array<string|int, mixed>

Array of color components is the range [0..1]

Return values
mixed

getHexValue()

Get the normalized hexadecimal value of the specified float fraction

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

Fraction value to convert [0..1]

$max : int

Maximum value to return (reference value)

Return values
int

value [0..$max]

getNormalizedValue()

Get the normalized integer value of the specified float fraction

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

Fraction value to convert [0..1]

$max : int

Maximum value to return (reference value)

Return values
int

value [0..$max]

getRgbaHexColor()

Get the Hexadecimal representation of the color with alpha channel: #RRGGBBAA

public getRgbaHexColor() : string
Return values
string

getRgbHexColor()

Get the Hexadecimal representation of the color: #RRGGBB

public getRgbHexColor() : string
Return values
string

getType()

Get the color model type (GRAY, RGB, HSL, CMYK)

public getType() : string
Return values
string
 

© 2004-2021 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy