\Tonesque

Summary

Methods
Properties
Constants
__construct()
imagecreatefromurl()
color()
grab_points()
grab_color()
get_color()
contrast()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$image_url
$image_obj
$color
N/A

Properties

$image_url

$image_url

$image_obj

$image_obj

$color

$color

Methods

__construct()

__construct( $image_url)

Parameters

$image_url

imagecreatefromurl()

imagecreatefromurl( $image_url)

Parameters

$image_url

color()

color(\optional $type) : \color

Construct object from image.

Parameters

\optional $type

(hex, rgb, hsl)

Returns

\color —

as a string formatted as $type

grab_points()

grab_points(mixed $type) : \array()

Grabs the color index for each of five sample points of the image

Parameters

mixed $type

can be 'index' or 'hex'

Returns

\array() —

with color indices

grab_color()

grab_color() : \array()

Finds the average color of the image based on five sample points

Returns

\array() —

with rgb color

get_color()

get_color( $color,  $type) : string

Get a Color object using /lib class.color Convert to appropriate type

Parameters

$color
$type

Returns

string

contrast()

contrast() : string

Checks contrast against main color Gives either black or white for using with opacity

Returns

string