mero / delphi-compat
Interpret data generated by Delphi resources.
Installs: 1 480
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.5.9
Requires (Dev)
- phpunit/phpunit: ~4.4
- satooshi/php-coveralls: ~0.6.1
This package is auto-updated.
Last update: 2023-04-17 02:19:39 UTC
README
Interpret data generated by Delphi resources.
Requeriments
- PHP 5.5.9 or above
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.
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" } }