PHP Classes

File: src/Contracts/Managers/ColorManagerInterface.php

Recommend this page to a friend!
  Packages of Amirreza Ebrahimi   HeroQR Powerful PHP QR Code Library to generate PNG, SVG, PDF, Logos Ready to Use with Laravel   src/Contracts/Managers/ColorManagerInterface.php   Download  
File: src/Contracts/Managers/ColorManagerInterface.php
Role: Class source
Content type: text/plain
Description: Class source
Class: HeroQR Powerful PHP QR Code Library to generate PNG, SVG, PDF, Logos Ready to Use with Laravel
Generate QR code images in several formats
Author: By
Last change: feat: add SVG customization support for shapes, markers, and cursors (previously only PNG)
Date: 15 days ago
Size: 1,848 bytes
 

Contents

Class file image Download
<?php

namespace HeroQR\Contracts\Managers;

use
Endroid\QrCode\Color\ColorInterface;

/**
 * Defines the contract for managing QR code colors, including the main color,
 * background color, and label color. Each method allows setting and retrieving
 * color values, ensuring consistency and flexibility in QR code customization.
 */
interface ColorManagerInterface
{
   
/**
     * Set the foreground color of the QR code
     *
     * @param array $rgbaColor {Red: int, Green: int, Blue: int, Alpha: float|int} RGBA values
     * @return void
     * @throws \InvalidArgumentException If the RGBA array is invalid
     */
   
public function setColor(array $rgbaColor): void;

   
/**
     * Get the foreground color of the QR code
     *
     * @return ColorInterface The current foreground color
     */
   
public function getColor(): ColorInterface;

   
/**
     * Set the background color of the QR code
     *
     * @param array $rgbaColor {Red: int, Green: int, Blue: int, Alpha: float|int} RGBA values
     * @return void
     * @throws \InvalidArgumentException If the RGBA array is invalid
     */
   
public function setBackgroundColor(array $rgbaColor): void;

   
/**
     * Get the background color of the QR code
     *
     * @return ColorInterface The current background color
     */
   
public function getBackgroundColor(): ColorInterface;

   
/**
     * Set the label color of the QR code
     *
     * @param array $rgbaColor {Red: int, Green: int, Blue: int, Alpha: float|int} RGBA values
     * @return void
     * @throws \InvalidArgumentException If the RGBA array is invalid
     */
   
public function setLabelColor(array $rgbaColor): void;

   
/**
     * Get the label color of the QR code
     *
     * @return ColorInterface The current label color
     */
   
public function getLabelColor(): ColorInterface;
}