Libs/MojoCube.Api/UI/ColorPicker.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;
namespace MojoCube.Api.UI
{
public class ColorPicker
{
public static string MiniColorPicker(string visual)
{
StringBuilder sb = new StringBuilder();
visual = visual.ToLower();
string[] colorList = new string[] { "", "#008000", "#ff0000", "#0000ff", "#ffff00", "#ff00ff", "#000000" };
for (int i = 0; i < colorList.Length; i++)
{
if (visual == colorList[i] && colorList[i] != string.Empty)
{
sb.Append("<div style='float:left; width:15px; height:15px; margin:0 2px; cursor:pointer; border:solid 2px #666; background:" + colorList[i] + "' onclick=\"colorPicker(this,'" + colorList[i] + "')\"></div>");
}
else if (colorList[i] == string.Empty)
{
sb.Append("<div id='Null' style='float:left; width:15px; height:15px; margin-right:2px; cursor:pointer;' onclick=\"colorPicker(this,'" + colorList[i] + "')\" title='无'></div>");
}
else
{
sb.Append("<div style='float:left; width:15px; height:15px; margin:0 2px; cursor:pointer; background:" + colorList[i] + "' onclick=\"colorPicker(this,'" + colorList[i] + "')\"></div>");
}
}
sb.Append("<input id='Binded' name='ColorPicker' type='hidden' value='" + visual + "' />");
return sb.ToString();
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
