Get text with styles.

@return string
346004
public function get()
    {
        if ($this->argument instanceof Argument && ! $this->argument->has('color')) {
            return $this->text;
        }

        $text = '';
        if ($this->foregroundColor !== '') {

            //~ Highlight
            $highlight = $this->hasHighlightedForeground ? static::HIGH_FOREGROUND : static::REGULAR_FOREGROUND;

            //~ Decoration
            $decoration = $this->isBold ? static::DECORATION_BOLD : '';
            $decoration .= $this->isUnderline ? static::DECORATION_UNDERLINE : '';
            $decoration = ! empty($decoration) ? $decoration : static::DECORATION_NONE;

            //~ Apply style
            $text .= self::BEGIN . $decoration . $highlight . $this->foregroundColor . self::END;
        }

        if ($this->backgroundColor !== '') {
            $highlight = $this->hasHighlightedBackground ? static::HIGH_BACKGROUND : static::REGULAR_BACKGROUND;
            $text .= self::BEGIN . $highlight . $this->backgroundColor . self::END;
        }

        $text .= $this->text . self::DESACTIVATE;

        return $text;
    }
1217940
public function style(): Style
    {
        $type = StyleType::get($this->style);

        return StyleFactory::factory($type)
            ->lineWidth($this->lineWidth);
    }
174794
public function addStylesheetGoogleFonts()
    {
        $str = '';

        foreach ($this->fonts as $url) {
            $str .= sprintf('<link href="%s" rel="stylesheet">', $url);
        }

        return $str;
    }
1128180
public function getSfStyleOutput(): SymfonyStyle
    {
        if (is_null($this->sfStyleOutput)) {
            $this->sfStyleOutput = new SymfonyStyle(new StringInput(''), new NullOutput());
        }
        return $this->sfStyleOutput;
    }
872166
public function getStyle()
    {
        $style = '';

        // Always add fixed height as a fallback if autosetting or JS fails.
        $height = $this->FixedHeight;
        if (!$height) {
            $height = 800;
        }
        $style .= "height: {$height}px; ";

        if ($this->AutoWidth) {
            $style .= "width: 100%; ";
        } elseif ($this->FixedWidth) {
            $style .= "width: {$this->FixedWidth}px; ";
        }

        return $style;
    }
15597
protected function _styleToString(&$style) {

        if (is_array($style)) {
            $css = $this->newStyle();
            foreach ($style as $prop => $val) {
                $css[$prop] = $val;
            }
            return $css->css();
        } elseif (is_a($style, '\\s4y\\Style')) {
            return $style->css();
        }
        return $style.PHP_EOL;
    }
69877
public function styles($styles = []) {
		$defaults = [
			'end'    => "\033[0m",
			'black'  => "\033[0;30m",
			'red'    => "\033[0;31m",
			'green'  => "\033[0;32m",
			'yellow' => "\033[0;33m",
			'blue'   => "\033[0;34m",
			'purple' => "\033[0;35m",
			'cyan'   => "\033[0;36m",
			'white'  => "\033[0;37m",
			'heading' => "\033[1;36m",
			'option'  => "\033[0;35m",
			'command' => "\033[0;35m",
			'error'   => "\033[0;31m",
			'success' => "\033[0;32m",
			'bold'    => "\033[1m",
		];
		if ($styles === false || $this->plain || strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
			return array_combine(array_keys($defaults), array_pad([], count($defaults), null));
		}
		return $styles + $defaults;
	}
1216067
public function getFormStyle()
    {
        $prop = array();

        $prop['alignment'] = $this->value['text-align'];

        if (isset($this->value['background']['color']) && is_array($this->value['background']['color'])) {
            $prop['fillColor'] = $this->value['background']['color'];
        }

        if (isset($this->value['border']['t']['color'])) {
            $prop['strokeColor'] = $this->value['border']['t']['color'];
        }

        if (isset($this->value['border']['t']['width'])) {
            $prop['lineWidth'] = $this->value['border']['t']['width'];
        }

        if (isset($this->value['border']['t']['type'])) {
            $prop['borderStyle'] = $this->value['border']['t']['type'];
        }

        if (!empty($this->value['color'])) {
            $prop['textColor'] = $this->value['color'];
        }

        if (!empty($this->value['font-size'])) {
            $prop['textSize'] = $this->value['font-size'];
        }

        return $prop;
    }
1131545
public function getStyle()
	{
		$values = array();

		if ($this->fgColor)
		{
			$values[] = $this->fgColor;
		}

		if ($this->bgColor)
		{
			$values[] = $this->bgColor;
		}

		foreach ($this->options as $option)
		{
			$values[] = static::$knownOptions[$option];
		}

		return implode(';', $values);
	}
816495
public function get_styles() {

		// Get an array of all our fields.
		$fields = self::$fields;

		// Check if we need to exit early.
		if ( empty( self::$fields ) || ! is_array( $fields ) ) {
			return;
		}

		// Initially we're going to format our styles as an array.
		// This is going to make processing them a lot easier
		// and make sure there are no duplicate styles etc.
		$css = array();

		// Start parsing our fields.
		foreach ( $fields as $field ) {

			// No need to process fields without an output, or an improperly-formatted output.
			if ( ! isset( $field['output'] ) || empty( $field['output'] ) || ! is_array( $field['output'] ) ) {
				continue;
			}

			// Get the value of this field.
			$value = self::get_option( $field['kirki_config'], $field['settings'] );

			// Start parsing the output arguments of the field.
			foreach ( $field['output'] as $output ) {
				$output = wp_parse_args(
					$output,
					array(
						'element'       => '',
						'property'      => '',
						'media_query'   => 'global',
						'prefix'        => '',
						'units'         => '',
						'suffix'        => '',
						'value_pattern' => '$',
						'choice'        => '',
					)
				);

				// If element is an array, convert it to a string.
				if ( is_array( $output['element'] ) ) {
					$output['element'] = implode( ',', $output['element'] );
				}

				// Simple fields.
				if ( ! is_array( $value ) ) {
					$value = str_replace( '$', $value, $output['value_pattern'] );
					if ( ! empty( $output['element'] ) && ! empty( $output['property'] ) ) {
						$css[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $value . $output['units'] . $output['suffix'];
					}
				} else {
					if ( 'typography' === $field['type'] ) {

						foreach ( $value as $key => $subvalue ) {

							// Add double quotes if needed to font-families.
							if ( 'font-family' === $key && false !== strpos( $subvalue, ' ' ) && false === strpos( $subvalue, '"' ) ) {
								$css[ $output['media_query'] ][ $output['element'] ]['font-family'] = '"' . $subvalue . '"';
							}

							// Variants contain both font-weight & italics.
							if ( 'variant' === $key ) {
								$font_weight = str_replace( 'italic', '', $subvalue );
								$font_weight = ( in_array( $font_weight, array( '', 'regular' ), true ) ) ? '400' : $font_weight;
								$css[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $font_weight;

								// Is this italic?
								if ( false !== strpos( $subvalue, 'italic' ) ) {
									$css[ $output['media_query'] ][ $output['element'] ]['font-style'] = 'italic';
								}
							} else {
								$css[ $output['media_query'] ][ $output['element'] ][ $key ] = $subvalue;
							}
						}
					} elseif ( 'multicolor' === $field['type'] ) {

						if ( ! empty( $output['element'] ) && ! empty( $output['property'] ) && ! empty( $output['choice'] ) ) {
							$css[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $value[ $output['choice'] ] . $output['units'] . $output['suffix'];
						}
					} else {

						foreach ( $value as $key => $subvalue ) {
							$property = $key;
							if ( false !== strpos( $output['property'], '%%' ) ) {
								$property = str_replace( '%%', $key, $output['property'] );
							} elseif ( ! empty( $output['property'] ) ) {
								$output['property'] = $output['property'] . '-' . $key;
							}
							if ( 'background-image' === $output['property'] && false === strpos( $subvalue, 'url(' ) ) {
								$subvalue = 'url("' . set_url_scheme( $subvalue ) . '")';
							}
							if ( $subvalue ) {
								$css[ $output['media_query'] ][ $output['element'] ][ $property ] = $subvalue;
							}
						}
					}
				}
			}
		}

		// Process the array of CSS properties and produce the final CSS.
		$final_css = '';
		if ( ! is_array( $css ) || empty( $css ) ) {
			return '';
		}

		// Parse the generated CSS array and create the CSS string for the output.
		foreach ( $css as $media_query => $styles ) {

			// Handle the media queries.
			$final_css .= ( 'global' !== $media_query ) ? $media_query . '{' : '';
			foreach ( $styles as $style => $style_array ) {

				$final_css .= $style . '{';
				foreach ( $style_array as $property => $value ) {

					$value = ( is_string( $value ) ) ? $value : '';

					// Make sure background-images are properly formatted.
					if ( 'background-image' === $property ) {
						if ( false === strrpos( $value, 'url(' ) ) {
							$value = set_url_scheme( $value );
							$value = 'url("' . esc_url_raw( $value ) . '")';
						}
					} else {
						$value = esc_textarea( $value );
					}
					$final_css .= $property . ':' . $value . ';';
				}
				$final_css .= '}';
			}
			$final_css .= ( 'global' !== $media_query ) ? '}' : '';
		}
		return $final_css;
	}
1122566
protected function stylingText()
	{
		$this->text['first_key'] = "[".$this->command->paintString($this->defaultOptions['first_key'] ,'green')."]";
		$this->text['second_key'] = "[".$this->command->paintString($this->defaultOptions['second_key'] ,'green')."]";
		$this->text['primary_key'] = "[".$this->command->paintString($this->defaultOptions['primary_key'] ,'green')."]";
		$this->text['model_table'] = "[".$this->command->paintString($this->model->getTable() ,'green')."]";
		$this->text['to_model_table'] = "[".$this->command->paintString($this->toModel->getTable() ,'green')."]";
		$this->text['intermediate_model_table'] = "[".$this->command->paintString($this->defaultOptions['intermediate_model']->getTable() ,'green')."]";
		$this->text['foreign_text'] = $this->command->paintString('foreign key', 'brown');
		$this->text['primary_text'] = $this->command->paintString('primary key', 'brown');
	}
539580
protected function stylingText()
    {
        $modelTable = $this->model->getTable();
        $toModelTable = $this->toModel->getTable();
        $pivotTable = $this->defaultOptions['pivot_table'];
        $foreignKey = $this->defaultOptions['foreign_key'];
        $relatedKey = $this->defaultOptions['related_key'];

        $this->text = [
            'table' => "[".$this->command->paintString($modelTable ,'green')."]",
            'to_table' => "[".$this->command->paintString($toModelTable ,'green')."]",
            'pivot_table' => "[".$this->command->paintString($pivotTable ,'green')."]",
            'foreign_key' => "[".$this->command->paintString($foreignKey ,'green')."]",
            'related_key' => "[".$this->command->paintString($relatedKey ,'green')."]",
            'pivot_text' => $this->command->paintString('pivot table', 'brown'),
            'foreign_text' => $this->command->paintString('foreign key', 'brown'),
            'related_text' => $this->command->paintString('related key', 'brown'),
        ];
    }
1240451
protected function makeStyles($styles = array())
        {
            $styles = array_merge($this->styles, $styles);
            $output = '';
            foreach ($styles as $property => $value) {
                $output .= $property . ':' . $value . ';';
            }

            return $output;
        }
1041260
public function getHeaderText(): string
    {
        $header      = $this->getHeaderElement();
        $header_text = $header->getText();
        $header_link = $header->find('css', 'a');

        // The page headers can often include an 'add new link'. Strip that out of the header text.
        if ($header_link) {
            $header_text = trim(str_replace($header_link->getText(), '', $header_text));
        }

        return $header_text;
    }
229781
protected function stylingText()
    {
        parent::stylingText();

        $this->text['table'] = "[".$this->command->paintString($this->model->getTable(), 'green')."]";
        $this->text['primary_key'] = "[".$this->command->paintString($this->defaultOptions['primary_key'], 'green')."]";
        $this->text['primary_text'] = $this->command->paintString('primary key', 'brown');
    }
458830
public function sectionStyles()
	{
		$result = '';
			Eresus_Kernel::app()->getPage()->title .= ADM_T_DIV.ADM_THEMES_STYLES;
		switch (arg('action'))
		{
			case 'update':
				$this->sectionStylesUpdate();
				break;

			case 'insert':
				$this->sectionStylesInsert();
				break;

			case 'add':
				$result = $this->sectionStylesAdd();
				break;

			default:
				if (arg('delete'))
				{
					$this->sectionStylesDelete();
				}
				elseif (arg('id'))
				{
					$result = $this->sectionStylesEdit();
				}
				else
				{
					$result = $this->sectionStylesList();
				}
		}
		return $result;
	}
1126745
public function asPlainText(): string
    {
        return $this->text ?? $this->text = (new Html2Text($this->html))->getText();
    }