本文整理汇总了PHP中PHPRtfLite::convertHexColorToRtf方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPRtfLite::convertHexColorToRtf方法的具体用法?PHP PHPRtfLite::convertHexColorToRtf怎么用?PHP PHPRtfLite::convertHexColorToRtf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPRtfLite
的用法示例。
在下文中一共展示了PHPRtfLite::convertHexColorToRtf方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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);
}
示例2: setBackgroundColor
/**
* Sets background color
*
* @param string $backgroundColor
*/
public function setBackgroundColor($backgroundColor)
{
$this->_backgroundColor = PHPRtfLite::convertHexColorToRtf($backgroundColor);
}
示例3: __construct
/**
* 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);
}
}
示例4: setBackgroundColor
/**
* Sets background color
*
* @param string $color background color
*/
public function setBackgroundColor($color)
{
$color = PHPRtfLite::convertHexColorToRtf($color);
$this->_table->getRtf()->addColor($color);
$this->_backgroundColor = $color;
}