我的代码是:
\documentclass[]{article}
\usepackage{array,booktabs,makecell}
\usepackage{relsize}
\usepackage{collcell}
\usepackage[table]{xcolor}
\usepackage{pgf} %
\usepackage[flushleft]{threeparttable}
\definecolor{highNeuro}{HTML}{F8F7F5}
\definecolor{lowNeuro}{HTML}{7B3A98}
\newcommand*{\opacity}{100}%
\newcommand*{\minvalNeuro}{-1.0}%
\newcommand*{\maxvalNeuro}{0.5}%
\newcommand{\gradientNeuro}[1]{
% The values are calculated linearly between \minvalNeuro and \maxvalNeuro
\ifdimcomp{#1pt}{>}{\maxvalNeuro pt}{#1}{
\ifdimcomp{#1pt}{<}{\minvalNeuro pt}{#1}{
\pgfmathparse{int(round(100*(#1/(\maxvalNeuro-\minvalNeuro))-(\minvalNeuro*(100/(\maxvalNeuro-\minvalNeuro)))))}
\xdef\tempa{\pgfmathresult}
\cellcolor{highNeuro!\tempa!lowNeuro!\opacity} #1
}}
}
\definecolor{highICC}{HTML}{7B3A98}
\definecolor{lowICC}{HTML}{F8F7F5}
\newcommand*{\minvalICC}{-0.5}%
\newcommand*{\maxvalICC}{1.0}%
\newcommand{\gradientICC}[1]{
% The values are calculated linearly between \minvalICC and \maxvalICC
\ifdimcomp{#1pt}{>}{\maxvalICC pt}{#1}{
\ifdimcomp{#1pt}{<}{\minvalICC pt}{#1}{
\pgfmathparse{int(round(100*(#1/(\maxvalICC-\minvalICC))-(\minvalICC*(100/(\maxvalICC-\minvalICC)))))}
\xdef\tempa{\pgfmathresult}
\cellcolor{highICC!\tempa!lowICC!\opacity} #1
}}
}
\definecolor{highWMH}{HTML}{F8F7F5}
\definecolor{lowWMH}{HTML}{7B3A98}
\newcommand*{\minvalWMH}{-1.0}%
\newcommand*{\maxvalWMH}{0.5}%
\newcommand{\gradientWMH}[1]{
% The values are calculated linearly between \minvalWMH and \maxvalWMH
\ifdimcomp{#1pt}{>}{\maxvalWMH pt}{#1}{
\ifdimcomp{#1pt}{<}{\minvalWMH pt}{#1}{
\pgfmathparse{int(round(100*(#1/(\maxvalWMH-\minvalWMH))-(\minvalWMH*(100/(\maxvalWMH-\minvalWMH)))))}
\xdef\tempa{\pgfmathresult}
\cellcolor{highWMH!\tempa!lowWMH!\opacity} #1
}}
}
\begin{document}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|}
\hline
\textbf{ROI\textbackslash Network} &
\textbf{VoxResNet} &
\textbf{VNet} &
\textbf{3D Unet} &
\textbf{\begin{tabular}[c]{@{}c@{}}Attention\\ UNet\end{tabular}} &
\textbf{\begin{tabular}[c]{@{}c@{}}AnatomyNet\\ (SE)\end{tabular}} &
\textbf{\begin{tabular}[c]{@{}c@{}}AnatomyNet\\ (CE+SE)\end{tabular}} &
\textbf{\begin{tabular}[c]{@{}c@{}}AnatomyNet\\ (Vanilla)\end{tabular}} &
\textbf{\begin{tabular}[c]{@{}c@{}}AnatomyNet\\ (CE)\end{tabular}} &
\textbf{nnU-Net} &
\textbf{nnU-Net-CRUISE} \\ \hline
\textbf{Visual} & \gradientICC{0.40} & \gradientICC{0.27} & \gradientICC{0.39} & \gradientICC{0.40} & \gradientICC{0.32} & \gradientICC{0.41} & \gradientICC{0.34} & \gradientICC{0.53} & \gradientICC{0.54} & \gradientICC{0.55} \\ \hline
\textbf{Motor} & \gradientICC{0.59} & \gradientICC{0.03} & \gradientICC{0.25} & \gradientICC{0.03} & \gradientICC{0.11} & \gradientICC{0.04} & \gradientICC{0.08} & \gradientICC{0.46} & \gradientICC{0.72} & \gradientICC{0.75} \\ \hline
\end{tabular}
\end{document}
它产生的输出如下:
我需要转换成 HTML 格式,为此我使用的是Make4ht
,表格转换得很好,但没有颜色。我也需要在 HTML 文件中显示颜色,请指教