mero/delphi-compat

This package is abandoned and no longer maintained. No replacement package was suggested.

Interpret data generated by Delphi resources.

0.1.0 2016-01-19 16:37 UTC

This package is auto-updated.

Last update: 2023-04-17 02:19:39 UTC


README

SensioLabsInsight Build Status Latest Stable Version Total Downloads License

Interpret data generated by Delphi resources.

Requeriments

  • PHP 5.5.9 or above

Instalation with composer

  1. Open your project directory;
  2. Run composer require mero/delphi-compat to add DelphiCompat in your project vendor.

TColor

Class for managing color in TColor format.

Name Atributes Description
__construct $color Construct calling setColor
setColor $color Define color using TColor format
getTColor Return color in TColor format
getRGB Return color in RGB format
getHex Return color in hex format

Usage example:

namespace Acme\Bundle\BlogBundle;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Mero\DelphiCompat\TColor;

class NewsController extends Controller
{

    /**
     * @Route("/", name="news")
     */
    public function indexAction()
    {
        $tcolor = new TColor("16744576");
        $colorRGB = $tcolor->getRGB(); // Return Array([r] => 128, [g] => 128, [b] => 255)
        $colorHex = $tcolor->getHex(); // Return "#8080ff"
        $colorTColor = $tcolor->getTColor(); // Return "16744576"
        $tcolor->setColor("0");
        $colorHex = $tcolor->getHex(); // Return "#000000"
    }

}