pyexlatex.models.format.text.color package

Subpackages

Submodules

pyexlatex.models.format.text.color.main module

class pyexlatex.models.format.text.color.main.TextColor(content, color, opacity=1.0, **kwargs)[source]

Bases: pyexlatex.models.section.base.TextAreaMixin, pyexlatex.models.item.MultiOptionSimpleItem

Changes the color of text.

Usage: >>> import pyexlatex as pl >>> pl.TextColor(‘something’, pl.Hex(‘59bf37’)) >>> pl.TextColor(‘something’, pl.RGB(89, 191, 55)) >>> pl.TextColor(‘something’, ‘blue’, opacity=0.5)

__init__(content, color, opacity=1.0, **kwargs)[source]
Parameters
  • content

  • color (Union[str, ForwardRef]) – can pass a string name of an existing color, such as ‘green’ or ‘red’, or can pass a defined color, using one of the ColorDefinition models, e.g. RGB or Hex

  • opacity (float) –

  • kwargs

property color_str: str
Return type

str

name = 'textcolor'
property opacity_str: str
Return type

str

process_color_get_name(color)[source]
Return type

str