
    Cj              	       ^    S SK JrJr  S SKJr  S SKJr  S SKJr  S\\   S\S\	S\\   4S	 jr
g
)    )Iterablecast)Segment)Style)Colorsegmentsbase_backgroundopacityreturnc              #     #    [         n[        R                  n[        R                  nUR
                  n[        SU 5      nU H  u  pn
U	nU	R                  b,  U" U	R                  5      nU" X5      nX" UR                  S9-  nU	R                  b,  U" U	R                  5      nU" X5      nX" UR                  S9-  nU" X5      v   M     g7f)a  Takes an iterable of foreground Segments and blends them into the supplied
background color, yielding copies of the Segments with blended foreground and
background colors applied.

Args:
    segments: The segments in the foreground.
    base_background: The background color to blend foreground into.
    opacity: The blending factor. A value of 1.0 means output segments will
        have identical foreground and background colors to input segments.
z#Iterable[tuple[str, Style, object]]N)color)bgcolor)
r   r   from_rich_colorr   
from_colorblendr   r   
rich_colorr   )r   r	   r
   _Segmentr   r   r   styled_segmentstextstyle_blended_styler   blended_foregroundr   blended_backgrounds                   b/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/textual/_opacity.py_apply_opacityr   	   s      H++O!!J!!E@(KO)Q;;"#EKK0E!&u!6Z.@.K.KLLM==$%emm4G!&w!8Z0B0M0MNNMt++ *s   C
CN)typingr   r   rich.segmentr   
rich.styler   textual.colorr   floatr        r   <module>r$      sD    !    !,w!,!, !, g	!,r#   