Documentation

Cmyk extends AbstractColor
in package
implements ArrayAccess

Image CMYK color class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
1.0.0

Table of Contents

Interfaces

ArrayAccess

Constants

COMMA  = 'COMMA'
String formats
CSS  = 'CSS'
PERCENT  = 'PERCENT'

Properties

$c  : float
Cyan
$k  : float
Black
$m  : float
Magenta
$y  : float
Yellow

Methods

__construct()  : mixed
Constructor
__get()  : mixed
Magic method to return the color value
__isset()  : bool
Magic method to return whether the color value exists
__set()  : void
Magic method to set the color value
__toString()  : string
Method to print the color object
__unset()  : void
Magic method to unset color value
getC()  : float
Get the cyan value
getK()  : float
Get the black value
getM()  : float
Get the magenta value
getY()  : float
Get the yellow value
offsetExists()  : bool
ArrayAccess offsetExists
offsetGet()  : mixed
ArrayAccess offsetGet
offsetSet()  : void
ArrayAccess offsetSet
offsetUnset()  : void
ArrayAccess offsetUnset
render()  : string
Convert to readable string
setC()  : Cmyk
Set the cyan value
setK()  : Cmyk
Set the black value
setM()  : Cmyk
Set the magenta value
setY()  : Cmyk
Set the yellow value
toArray()  : array<string|int, mixed>
Convert to array
toGray()  : Grayscale
Convert to Gray
toRgb()  : Rgb
Convert to RGB

Constants

Properties

$c

Cyan

protected float $c = 0

$k

Black

protected float $k = 0

$m

Magenta

protected float $m = 0

$y

Yellow

protected float $y = 0

Methods

__construct()

Constructor

public __construct(mixed $c, mixed $m, mixed $y, mixed $k) : mixed

Instantiate a PERCENT CMYK Color object

Parameters
$c : mixed

0 - 100

$m : mixed

0 - 100

$y : mixed

0 - 100

$k : mixed

0 - 100

__get()

Magic method to return the color value

public __get(string $name) : mixed
Parameters
$name : string
Tags
throws
Exception

__isset()

Magic method to return whether the color value exists

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__set()

Magic method to set the color value

public __set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed
Tags
throws
Exception

__toString()

Method to print the color object

public __toString() : string
Return values
string

__unset()

Magic method to unset color value

public __unset(string $name) : void
Parameters
$name : string
Tags
throws
Exception

getC()

Get the cyan value

public getC() : float
Return values
float

getK()

Get the black value

public getK() : float
Return values
float

getM()

Get the magenta value

public getM() : float
Return values
float

getY()

Get the yellow value

public getY() : float
Return values
float

offsetExists()

ArrayAccess offsetExists

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

ArrayAccess offsetGet

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed
Tags
throws
Exception

offsetSet()

ArrayAccess offsetSet

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
Tags
throws
Exception

offsetUnset()

ArrayAccess offsetUnset

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed
Tags
throws
Exception

render()

Convert to readable string

public render([string|null $format = null ]) : string
Parameters
$format : string|null = null
Return values
string

setC()

Set the cyan value

public setC(mixed $c) : Cmyk
Parameters
$c : mixed
Tags
throws
OutOfRangeException
Return values
Cmyk

setK()

Set the black value

public setK(mixed $k) : Cmyk
Parameters
$k : mixed
Tags
throws
OutOfRangeException
Return values
Cmyk

setM()

Set the magenta value

public setM(mixed $m) : Cmyk
Parameters
$m : mixed
Tags
throws
OutOfRangeException
Return values
Cmyk

setY()

Set the yellow value

public setY(mixed $y) : Cmyk
Parameters
$y : mixed
Tags
throws
OutOfRangeException
Return values
Cmyk

toArray()

Convert to array

public toArray([bool $assoc = true ]) : array<string|int, mixed>
Parameters
$assoc : bool = true
Return values
array<string|int, mixed>

toRgb()

Convert to RGB

public toRgb() : Rgb
Return values
Rgb

        
On this page

Search results