1. function Colorstr_Colortable(color) --字符串 table
    2. local Color = {}
    3. for w in string.gmatch(color,"[^,]+") do
    4. local i = 0
    5. local t = {}
    6. for xy in string.gmatch(w,"[^|]+") do
    7. i = i + 1
    8. if i == 1 then
    9. t.x = tonumber(xy)
    10. end
    11. if i == 2 then
    12. t.y = tonumber(xy)
    13. break
    14. end
    15. end
    16. local co = string.sub(w,string.find(w,'0x'),-1)
    17. i = 0
    18. for Degree in string.gmatch(co,"[^|]+") do
    19. i = i + 1
    20. if i == 2 then
    21. t.degree = tonumber(Degree)
    22. break
    23. end
    24. end
    25. i = 0
    26. for offset in string.gmatch(co,"[^-]+") do
    27. i = i + 1
    28. if i == 2 then
    29. t.offset = tonumber("0x"..offset)
    30. break
    31. end
    32. end
    33. t.color = tonumber(string.sub(co,1,8))
    34. table.insert(Color,t)
    35. end
    36. return Color
    37. end
    38. --[[
    39. {
    40. ['y'] = 268,
    41. ['x'] = 898,
    42. ['degree'] = 95,
    43. ['color'] = 2193658,
    44. ['offset'] = 0
    45. }
    46. ]]