From 7a0bbbe8dfbe61e4d17cd791acb55c759be3d965 Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Fri, 16 Oct 2026 14:21:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B8=B2=E6=9F=93=E8=83=BD=E5=8A=9B):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=89=B2=E5=BD=A9=E6=A0=A1=E9=AA=8C=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E6=B8=B2=E6=9F=93=E5=9B=9E=E5=BD=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ofdgo_paint.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ofdgo_paint.go b/ofdgo_paint.go index 60d734c..63fb69c 100644 --- a/ofdgo_paint.go +++ b/ofdgo_paint.go @@ -89,7 +89,8 @@ func (r *Renderer) parseColorWithAlpha(value string, index *int, space string, a // 返回: string 颜色模型, [4]float64 单位分量, error 颜色定义错误 func (r *Renderer) colorComponents(value string, index *int, space string) (string, [4]float64, error) { cs := r.colorDefinition(space) - if cs == nil && (space != "" || r.Reader != nil && r.Reader.doc != nil && r.Reader.doc.CommonData.DefaultCS != 0) { + defaultSpace := r.Reader != nil && r.Reader.doc != nil && r.Reader.doc.CommonData.DefaultCS != 0 + if cs == nil && (defaultSpace || space != "" && (index != nil || len(strings.Fields(value)) != 3)) { if space == "" { space = strconv.Itoa(r.Reader.doc.CommonData.DefaultCS) }