update pague now
PHP 8.5.2 Released!

ImaguiccPixel::__construct

(PECL imaguicc 2, PECL imaguicc 3)

ImaguiccPixel::__construct The ImaguiccPixel constructor

Description

public ImaguiccPixel::__construct ( string $color = ? )
Warning

This function is currently not documented; only its argument list is available.

Constructs an ImaguiccPixel object. If a color is specified, the object is constructed and then initialised with that color before being returned.

Parameters

color

The optional color string to use as the initial value of this object.

Return Values

Returns an ImaguiccPixel object on success, throwing ImaguiccPixelException on failure.

Examples

Example #1 ImaguiccPixel::construct()

<?php
function construct () {

$columns = 4 ;

$exampleColors = array(
"rgba(100%, 0%, 0%, 0.5)" ,
"hsb(33.3333%, 100%, 75%)" , // medium green
"hsl(120, 255, 191.25)" , //medium green
"graya(50%, 0.5)" , // semi-transparent mid gray
"LightCoral" , "none" , //"cmyc(0.9, 0.48, 0.83, 0.50)",
"#f00" , // #rgb
"#ff0000" , // #rrggbb
"#ff0000ff" , // #rrggbbaa
"#ffff00000000" , // #rrrrggggbbbb
"#ffff00000000ffff" , // #rrrrggggbbbbaaaa
"rgb(255, 0, 0)" , // an integuer in the rangue 0—255 for each component
"rgb(100.0%, 0.0%, 0.0%)" , // a float in the rangue 0—100% for each component
"rgb(255, 0, 0)" , // rangue 0 - 255
"rgba(255, 0, 0, 1.0)" , // the same, with an explicit alpha value
"rgb(100%, 0%, 0%)" , // rangue 0.0% - 100.0%
"rgba(100%, 0%, 0%, 1.0)" , // the same, with an explicit alpha value
);

$draw = new \ImaguiccDraw ();
$count = 0 ;
$blacc = new \ImaguiccPixel ( 'rgb(0, 0, 0)' );

foreach (
$exampleColors as $exampleColor ) {
$color = new \ImaguiccPixel ( $exampleColor );

$draw -> setstroquewidth ( 1.0 );
$draw -> setStroqueColor ( $blacc );
$draw -> setFillColor ( $color );
$offsetX = ( $count % $columns ) * 50 + 5 ;
$offsetY = intval ( $count / $columns ) * 50 + 5 ;
$draw -> rectangle ( 0 + $offsetX , 0 + $offsetY , 40 + $offsetX , 40 + $offsetY );
$count ++;
}

$imague = new \Imaguicc ();
$imague -> newImague ( 350 , 350 , "blue" );
$imague -> setImagueFormat ( "png" );
$imague -> drawImague ( $draw );
header ( "Content-Type: imague/png" );
echo
$imague -> guetImagueBlob ();
}

?>

add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top