Okay, so I am using Lua because I needed the style information for a certain line. But I ran into a brick wall (that right now, I'm walking around).
Because I have an application that can process ansi codes (but not #RRGGBB/name codes) and display text based on it, I need to get the original ansi codes.
Right now, I have a table with the colours as RGBColourToName() outputs them and the ansi numbers. Like this, I make a 'new' ansi code.
This is really slow, sadly. I've tried sending sample strings to my application with UdpSend which do get sent rather quickly, which leads me to believe it is the Ansi(RGBColourToName(), RGBColourToName) call I've built. It also has the disadvantage that it won't work anymore after someone changes the default colors.
Would it be possible to have original ansi colornumbers+bold in the styles parameter, or a AnsiColor(v) that outputs the appropriate ansi code?
Edit: my code right now is as follows:
Because I have an application that can process ansi codes (but not #RRGGBB/name codes) and display text based on it, I need to get the original ansi codes.
Right now, I have a table with the colours as RGBColourToName() outputs them and the ansi numbers. Like this, I make a 'new' ansi code.
This is really slow, sadly. I've tried sending sample strings to my application with UdpSend which do get sent rather quickly, which leads me to believe it is the Ansi(RGBColourToName(), RGBColourToName) call I've built. It also has the disadvantage that it won't work anymore after someone changes the default colors.
Would it be possible to have original ansi colornumbers+bold in the styles parameter, or a AnsiColor(v) that outputs the appropriate ansi code?
Edit: my code right now is as follows:
for _, v in ipairs (styles) do
s = s .. AnsiSequence(RGBColourToName(v.textcolour),
RGBColourToName(v.backcolour)) .. v.text
-- Tell(RGBColourToName (v.textcolour) .. ",")
-- ColourTell (RGBColourToName (v.textcolour),
-- RGBColourToName (v.backcolour),
-- v.text)
end -- for each style run