PhpOffice\PhpPresentation\Style\Color::getRGB PHP Method

getRGB() public method

Get RGB
public getRGB ( ) : string
return string
    public function getRGB()
    {
        if (strlen($this->argb) == 6) {
            return $this->argb;
        } else {
            return substr($this->argb, 2);
        }
    }

Usage Example

コード例 #1
0
ファイル: ColorTest.php プロジェクト: hxsam/PHPPresentation
 /**
  * Test get/set RGB
  */
 public function testSetGetRGB()
 {
     $object = new Color();
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->setRGB());
     $this->assertEquals('000000', $object->getRGB());
     $this->assertEquals('FF000000', $object->getARGB());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->setRGB(''));
     $this->assertEquals('000000', $object->getRGB());
     $this->assertEquals('FF000000', $object->getARGB());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->setRGB('555'));
     $this->assertEquals('555', $object->getRGB());
     $this->assertEquals('FF555', $object->getARGB());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->setRGB('6666'));
     $this->assertEquals('FF6666', $object->getRGB());
     $this->assertEquals('FF6666', $object->getARGB());
 }
All Usage Examples Of PhpOffice\PhpPresentation\Style\Color::getRGB