/** * Constructor * @param integer $size size of border * @param string $color color of border (example '#ff0000' or '#f00') * @param string $type represented by class constants PHPRtfLite_Border_Format::TYPE_*<br> * Possible values:<br> * TYPE_SINGLE => 'single'<br> * TYPE_DOT = 'dot'<br> * TYPE_DASH = 'dash'<br> * TYPE_DOTDASH = 'dotdash'<br> * @param float $space space between borders and the paragraph */ public function __construct($size = 0, $color = null, $type = null, $space = 0) { $this->_size = $size * PHPRtfLite::SPACE_IN_POINTS; $this->_type = $type; if ($color) { $this->_color = PHPRtfLite::convertHexColorToRtf($color); } $this->_space = round($space * PHPRtfLite::TWIPS_IN_CM); }
/** * Sets background color * * @param string $backgroundColor */ public function setBackgroundColor($backgroundColor) { $this->_backgroundColor = PHPRtfLite::convertHexColorToRtf($backgroundColor); }
/** * Constructor * * @param integer $size font size * @param string $fontFamily font family (etc. "Times new Roman", "Arial" and other) * @param string $color font color * @param string $backgroundColor background color of font */ public function __construct($size = 10, $fontFamily = '', $color = '', $backgroundColor = '') { $this->_size = $size; $this->_fontFamily = $fontFamily; if ($color) { $this->_color = PHPRtfLite::convertHexColorToRtf($color); } if ($backgroundColor) { $this->_backgroundColor = PHPRtfLite::convertHexColorToRtf($backgroundColor); } }
/** * Sets background color * * @param string $color background color */ public function setBackgroundColor($color) { $color = PHPRtfLite::convertHexColorToRtf($color); $this->_table->getRtf()->addColor($color); $this->_backgroundColor = $color; }