Пример #1
0
 /**
  * Makes bg color code
  *
  * @param string $color
  * @return string
  */
 public static function bgColor($color)
 {
     return Code::make(Code::BG_COLOR, [Code::colorCode($color)]);
 }
Пример #2
0
 public function code()
 {
     Code::make();
 }
Пример #3
0
 /**
  * Composes styled string
  *
  * @return string
  */
 public function compose()
 {
     $prefix = Code::makeStyle($this->fgColor, $this->bgColor, $this->attributes);
     $suffix = '';
     if (!empty($prefix)) {
         $suffix = Code::make(Code::STYLE_RESET);
     }
     return $prefix . $this->text . $suffix;
 }