PHP code example of mero / delphi-compat

1. Go to this page and download the library: Download mero/delphi-compat library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mero / delphi-compat example snippets


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"
    }

}