library delphi-compat
Interpret data generated by Delphi resources.
mero/delphi-compat
Interpret data generated by Delphi resources.
- Thursday, October 6, 2016
- by merorafael
- Repository
- 1 Watchers
- 0 Stars
- 575 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
DelphiCompat
, (*1)
Interpret data generated by Delphi resources., (*2)
Requeriments
Instalation with composer
- Open your project directory;
- Run
composer require mero/delphi-compat to add DelphiCompat in your project vendor.
TColor
Class for managing color in TColor format., (*3)
| 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"
}
}