Color

Color’s parents are Track or Marker.

Read color informations

use PhpTabs\PhpTabs;

$song = new PhpTabs('my-song.gp5');

// Get first track's color
$color = $song->getTrack(0)->getColor();

echo sprintf("
Color
-----

red: %s
green: %s
blue: %s
",

$color->getR(),
$color->getG(),
$color->getB()
);

It will ouput something like:

Color
-----

red: 255
green: 0
blue: 0

Write color informations

$color->setR(0);
$color->setG(255);
$color->setB(128);

Compare

You may compare current color to another one.

$bool = $color->isEqual($color);

Copy

You may copy all attributes from another color.

// Copy from another color
$newColor>copyFrom($color);