From 330e3ae4cdd1e9facb14b6ea2b3e609166c04fd3 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 12 一月 2021 16:00:27 +0800
Subject: [PATCH] 2021-1-12-1

---
 HDL_ON/Entity/Function/Light.cs |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/HDL_ON/Entity/Function/Light.cs b/HDL_ON/Entity/Function/Light.cs
index f9843cb..34d5363 100644
--- a/HDL_ON/Entity/Function/Light.cs
+++ b/HDL_ON/Entity/Function/Light.cs
@@ -176,10 +176,10 @@
                 }
                 if (trait_color.curValue.ToString() == "{}")
                     trait_color.curValue = "255,255,255";
-                int.TryParse(trait_color.curValue.ToString().Split(",")[0], out redColor);
-                int.TryParse(trait_color.curValue.ToString().Split(",")[1], out greenColor);
-                int.TryParse(trait_color.curValue.ToString().Split(",")[2], out blueColor);
             }
+            int.TryParse(trait_color.curValue.ToString().Split(",")[0], out redColor);
+            int.TryParse(trait_color.curValue.ToString().Split(",")[1], out greenColor);
+            int.TryParse(trait_color.curValue.ToString().Split(",")[2], out blueColor);
 
             int recolor = redColor * 256 * 256 + greenColor * 256 + blueColor;
 
@@ -202,6 +202,7 @@
             redColor = color[0];
             greenColor = color[1];
             blueColor = color[2];
+            trait_color.curValue = redColor + "," + greenColor + "," + blueColor;
         }
 
         [Newtonsoft.Json.JsonIgnore]

--
Gitblit v1.8.0