| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/dansnotreville-fr/nice/libraries/CBLib/Imagine/Image/Palette/ |
Upload File : |
<?php
/*
* This file is part of the Imagine package.
*
* (c) Bulat Shakirzyanov <mallluhuct@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Imagine\Image\Palette;
use Imagine\Image\Palette\Color\ColorInterface;
use Imagine\Image\ProfileInterface;
/**
* Interface that any palette must implement.
*/
interface PaletteInterface
{
/**
* Palette name: grayscale.
*
* @var string
*/
const PALETTE_GRAYSCALE = 'gray';
/**
* Palette name: RGB.
*
* @var string
*/
const PALETTE_RGB = 'rgb';
/**
* Palette name: CMYK.
*
* @var string
*/
const PALETTE_CMYK = 'cmyk';
/**
* Returns a color given some values.
*
* @param string|int[]|int $color A color
* @param int|null $alpha Set alpha to null to disable it
*
* @throws \Imagine\Exception\InvalidArgumentException In case you pass an alpha value to a Palette that does not support alpha
*
* @return \Imagine\Image\Palette\Color\ColorInterface
*/
public function color($color, $alpha = null);
/**
* Blend two colors given an amount.
*
* @param \Imagine\Image\Palette\Color\ColorInterface $color1
* @param \Imagine\Image\Palette\Color\ColorInterface $color2
* @param float $amount The amount of color2 in color1
*
* @return \Imagine\Image\Palette\Color\ColorInterface
*/
public function blend(ColorInterface $color1, ColorInterface $color2, $amount);
/**
* Attachs an ICC profile to this Palette.
*
* (A default profile is provided by default)
*
* @param \Imagine\Image\ProfileInterface $profile
*
* @return $this
*/
public function useProfile(ProfileInterface $profile);
/**
* Returns the ICC profile attached to this Palette.
*
* @return \Imagine\Image\ProfileInterface
*/
public function profile();
/**
* Returns the name of this Palette, one of PaletteInterface::PALETTE_ constants.
*
* @return string
*/
public function name();
/**
* Returns an array containing ColorInterface::COLOR_* constants that
* define the structure of colors for a pixel.
*
* @return string[]
*/
public function pixelDefinition();
/**
* Tells if alpha channel is supported in this palette.
*
* @return bool
*/
public function supportsAlpha();
/**
* Get the max value of palette components (255 for RGB and Grayscale, 100 for CMYK).
*
* @return int
*/
public function getChannelsMaxValue();
}