此代码目前仅适用于数字和英文文本。但是,文本的颜色无法正确应用于波斯语文本。我该如何修改它以实现与波斯语文本相同的效果?
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,snakes}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\graphicspath{ {./} }
\usepackage{xcolor}
%___________________
\usepackage{epigraph}
\newdimen\myx
\myx=\textwidth
\advance \myx by -20pt
\setlength\epigraphwidth{0.65\myx}
\setlength\epigraphrule{0.005cm}
%_____________________
\usepackage[extrafootnotefeatures]{xepersian}
\settextfont[Scale=1]{Shabnam.ttf}
\setlatintextfont[Scale=0.7]{Times New Roman}
\setdigitfont[Scale=1]{Shabnam.ttf}
\defpersianfont\titlefont[Scale=0.8]{Shabnam.ttf}
\defpersianfont\Mor[Scale=0.9]{Morvarid.ttf}
\defpersianfont\Sam[Scale=0.9]{Samim.ttf}
%______________________
\usepackage{setspace}
\doublespacing
\usepackage{bm}
%______________________________________
\usepackage[many]{tcolorbox}
\usepackage{varwidth}
\usepackage{environ}
\usepackage{xparse}
\newlength{\bubblesep}
\newlength{\bubblewidth}
\setlength{\bubblesep}{2pt}
\AtBeginDocument{\setlength{\bubblewidth}{.75\textwidth}}
\definecolor{bubblegreen}{RGB}{103,184,104}
\definecolor{bubblegray}{RGB}{241,240,240}
%___________COLORS_______________
% red #FF6B6B
% blue #4D96FF
% green #6BCB77
% yellow #FFD93D
\definecolor{cred}{HTML}{FF6B6B} % Red
\definecolor{cgreen}{HTML}{6BCB77} % Green
\definecolor{cblue}{HTML}{4D96FF} % Blue
\definecolor{cyellow}{HTML}{FFD93D} % Yellow
%_________________________________
\newcommand{\bubble}[4]{%
\tcbox[
on line,
arc=4.5mm,
colback=#1,
colframe=#1,
#2,
]
{\color{#3}{\begin{varwidth}{\bubblewidth}#4\end{varwidth}}}
}
\ExplSyntaxOn
\seq_new:N \l__ooker_bubbles_seq
\tl_new:N \l__ooker_bubbles_first_tl
\tl_new:N \l__ooker_bubbles_last_tl
\NewEnviron{rightbubbles}
{
\begin{flushright}
\sffamily
\seq_set_split:NnV \l__ooker_bubbles_seq { \par } \BODY
\int_compare:nTF { \seq_count:N \l__ooker_bubbles_seq < 2 }
{
\bubble{bubblegreen}{rounded~corners}{white}{\BODY}\par
}
{
\seq_pop_left:NN \l__ooker_bubbles_seq \l__ooker_bubbles_first_tl
\seq_pop_right:NN \l__ooker_bubbles_seq \l__ooker_bubbles_last_tl
\bubble{bubblegreen}{sharp~corners=southeast}{white}{\l__ooker_bubbles_first_tl}
\par\nointerlineskip
\addvspace{\bubblesep}
\seq_map_inline:Nn \l__ooker_bubbles_seq
{
\bubble{bubblegreen}{sharp~corners=east}{white}{##1}
\par\nointerlineskip
\addvspace{\bubblesep}
}
\bubble{bubblegreen}{sharp~corners=northeast}{white}{\l__ooker_bubbles_last_tl}
\par
}
\end{flushright}
}
\NewEnviron{leftbubbles}
{
\begin{flushleft}
\sffamily
\seq_set_split:NnV \l__ooker_bubbles_seq { \par } \BODY
\int_compare:nTF { \seq_count:N \l__ooker_bubbles_seq < 2 }
{
\bubble{bubblegray}{rounded~corners}{black}{\BODY}\par
}
{
\seq_pop_left:NN \l__ooker_bubbles_seq \l__ooker_bubbles_first_tl
\seq_pop_right:NN \l__ooker_bubbles_seq \l__ooker_bubbles_last_tl
\bubble{bubblegray}{sharp~corners=southwest}{black}{\l__ooker_bubbles_first_tl}
\par\nointerlineskip
\addvspace{\bubblesep}
\seq_map_inline:Nn \l__ooker_bubbles_seq
{
\bubble{bubblegray}{sharp~corners=west}{black}{##1}
\par\nointerlineskip
\addvspace{\bubblesep}
}
\bubble{bubblegray}{sharp~corners=northwest}{black}{\l__ooker_bubbles_last_tl}\par
}
\end{flushleft}
}
\ExplSyntaxOff
%__________________________
\usepackage{cancel}
\newcommand{\Cancel}[2][red]{{\color{#1}\cancel{\color{black}#2}}}
%___________________________
\begin{document}
\begin{minipage}{400pt}
\input{physics1/chapter1/tutorials/final/defphysics/tutorial/tutorial5}
\end{minipage}
\end{document}