function getColorFromListItem()
if not isSampAvailable() then return end
if not sampIsDialogActive() then return end
local listid = sampGetCurrentDialogListItem()
local text = sampGetDialogText(sampGetCurrentDialogId())
local counter = 0
for line in text:gmatch("[^\n]+") do
if listid == counter then
local color, txt = line:match("({%x+})(%x+)")
if not color or not txt then return end
return color, text
end
counter = counter + 1
end
end