-
-
Notifications
You must be signed in to change notification settings - Fork 358
支持RRGGBB的6位颜色格式 #3199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
支持RRGGBB的6位颜色格式 #3199
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR expands the color format support to include non-hash 6-digit strings and refactors the color conversion logic for easier extensibility.
- Introduces an enum of color patterns for different color modes.
- Refactors color conversion functions into table methods to support future extensions.
- Adds support for non-hashed 6-digit RGB color strings.
Comments suppressed due to low confidence (1)
script/core/color.lua:94
- Ensure there are tests covering non-hashed 6-digit color strings to verify that the rgb6 conversion branch works as expected.
if source.type == 'string' then
in next,t改in pairs(t),写习惯了 Co-authored-by: Copilot <[email protected]>
不帶井號的 6位/8位長度的 string,不一定就是 color code 吧 😕
local dbconf = {
user = "root",
pass = "123456",
database = "test",
} => 這樣
local DATA = {
["000000"] = {
field = "a",
},
["000001"] = {
field = "b",
},
} 沒有
|
A 6-bit/8-bit length string without a pound mark may not be a color code 😕
local dbconf = {
user = "root",
pass = "123456",
database = "test",
} => In this way
local DATA = {
["000000"] = {
field = "a",
},
["000001"] = {
field = "b",
},
} No
|
啊,那确实是应该加设置,之前八位数字也是会误判成颜色的,只是我运气好没遇见过🤣 |
Ah, that should be set. The previous eight digits would be misjudged as colors, but I was lucky and never met them 🤣 |
既然 #3169 增加了
"#RRGGBB"
格式颜色的支持,那一些项目中有不带井号的6位颜色字符串也一起支持一下吧顺便把这部分功能做成更容易拓展的了