Re: [RFC] ColorD

2012-10-29 Thread Walter Bright
On 10/25/2012 3:27 PM, Jens Mueller wrote: Anybody an idea how to this on Linux? Much of this is implemented in one way or another as part of the source code for MicroEmacs, downloadable from digitalmars.com. https://github.com/DigitalMars/me

Re: [RFC] ColorD

2012-10-28 Thread Jens Mueller
Adam D. Ruppe wrote: Here we go, some more basic functions: http://arsdnet.net/dcode/terminal.d The unix stuff is more implemented than the windows. Let's walk through main and I'll discuss why I'm doing things the way I am. I'm throwing this out just to show one possible way this

Re: [RFC] ColorD

2012-10-28 Thread Jens Mueller
Tobias Pankrath wrote: On Tuesday, 23 October 2012 at 22:47:40 UTC, Walter Bright wrote: On 10/22/2012 3:55 AM, Andrei Alexandrescu wrote: On 10/22/12 9:47 AM, Jens Mueller wrote: This is probably interesting for Phobos. But I'm not the one to make a decision. The core Phobos developers

Re: [RFC] ColorD

2012-10-28 Thread Jens Mueller
Adam D. Ruppe wrote: It now can translate most PC keyboard input sequences into char or non-char key events, including requesting UTF-8 input for chars: http://arsdnet.net/dcode/terminal.d We could just about start writing real apps with this now. Biggest problem left is it doesn't

Re: [RFC] ColorD

2012-10-28 Thread Tobias Pankrath
If you can add an event loop on top that would be great. What do I need to make sure that you can add the event handling on top? Jens I don't think that this needs any special consideration. If you look at Adams code samples in this thread, he's building his own event loop on input.getch.

Re: [RFC] ColorD

2012-10-28 Thread Adam D. Ruppe
On Sunday, 28 October 2012 at 10:44:58 UTC, Jens Mueller wrote: How? The file /etc/termcap has the data too so opening it and quickly parsing should give the same result as the environment variable. It looks like this: vg|vt-generic|Generic VT entries:\ :bs:mi:ms:pt:xn:xo:it#8:\

Re: [RFC] ColorD

2012-10-28 Thread Jens Mueller
Adam D. Ruppe wrote: On Sunday, 28 October 2012 at 10:44:58 UTC, Jens Mueller wrote: How? The file /etc/termcap has the data too so opening it and quickly parsing should give the same result as the environment variable. I'm running Debian. It doesn't have such a file. It looks like this:

Re: [RFC] ColorD

2012-10-28 Thread Adam D. Ruppe
On Sunday, 28 October 2012 at 14:09:09 UTC, Jens Mueller wrote: I'm running Debian. It doesn't have such a file. They must just depend on terminfo. That's more complicated to read though - it isn't a plain text file anymore, so doing it without a library is going to be more of a pain. I

Re: [RFC] ColorD

2012-10-28 Thread H. S. Teoh
On Sun, Oct 28, 2012 at 03:15:46PM +0100, Adam D. Ruppe wrote: On Sunday, 28 October 2012 at 14:09:09 UTC, Jens Mueller wrote: I'm running Debian. It doesn't have such a file. They must just depend on terminfo. That's more complicated to read though - it isn't a plain text file anymore, so

Re: [RFC] ColorD

2012-10-28 Thread Adam D. Ruppe
On Sunday, 28 October 2012 at 14:53:31 UTC, H. S. Teoh wrote: Why not use a library? Terminfo is designed precisely for this. Sometimes linking in external libraries in Phobos can be a problem for licensing or Just Works portability. idk about terminfo, I haven't really looked at it. (tbh I

Re: [RFC] ColorD

2012-10-28 Thread Adam D. Ruppe
Robik let me add my code to his repository with the plan to merge the two files later, but for now I just pushed my file up there. https://github.com/robik/ConsoleD/blob/master/terminal.d It now has /etc/termcap support, a builtin termcap to work in a pinch if the system doesn't have one, and

Re: [RFC] ColorD

2012-10-28 Thread nazriel
On Sunday, 21 October 2012 at 19:28:21 UTC, Robik wrote: Hello, I would like to introduce ColorD, small library that allows to simply manipulate console output colors, both on Windows and Posix operating systems. It also supports font styles such as underline and strikethrough(Posix feature

Re: [RFC] ColorD

2012-10-27 Thread Adam D. Ruppe
On Friday, 26 October 2012 at 18:58:20 UTC, Adam D. Ruppe wrote: I think this is another benefit of capturing the input with a special type and method. I've implemented the basic events for linux now: http://arsdnet.net/dcode/terminal.d Still need to check more of the input sequences, but it

Re: [RFC] ColorD

2012-10-27 Thread Adam D. Ruppe
It now can translate most PC keyboard input sequences into char or non-char key events, including requesting UTF-8 input for chars: http://arsdnet.net/dcode/terminal.d We could just about start writing real apps with this now. Biggest problem left is it doesn't actually scan the termcap

Re: [RFC] ColorD

2012-10-27 Thread H. S. Teoh
On Sun, Oct 28, 2012 at 04:49:03AM +0100, Adam D. Ruppe wrote: It now can translate most PC keyboard input sequences into char or non-char key events, including requesting UTF-8 input for chars: http://arsdnet.net/dcode/terminal.d We could just about start writing real apps with this now.

Re: [RFC] ColorD

2012-10-26 Thread Robik
On Friday, 26 October 2012 at 01:35:43 UTC, Adam D. Ruppe wrote: On Thursday, 25 October 2012 at 22:27:52 UTC, Jens Mueller wrote: 5. setting the contents of the title bar The title bar of what? Here's how you do it on xterm: writefln(\033]0;%s\007, title); Yeah, the problem is it does

Re: [RFC] ColorD

2012-10-26 Thread Jens Mueller
H. S. Teoh wrote: On Fri, Oct 26, 2012 at 12:27:38AM +0200, Jens Mueller wrote: Walter Bright wrote: [...] A module that only sets the console color is a little too light to be a phobos entry. A more comprehensive module that included: 1. getting mouse input Anybody an

Re: [RFC] ColorD

2012-10-26 Thread Jens Mueller
Adam D. Ruppe wrote: On Thursday, 25 October 2012 at 22:27:52 UTC, Jens Mueller wrote: 5. setting the contents of the title bar The title bar of what? Here's how you do it on xterm: writefln(\033]0;%s\007, title); On Windows it is an api function:

Re: [RFC] ColorD

2012-10-26 Thread Adam D. Ruppe
On Friday, 26 October 2012 at 03:28:43 UTC, H. S. Teoh wrote: I don't think you can assume X11 calls will work. You may be running on GNU screen, or on a remote SSH connection. Yeah. Vim does it though, if it can connect to a display, it does and enhances its copy/paste ability. If it can't,

Re: [RFC] ColorD

2012-10-26 Thread Tobias Pankrath
On Tuesday, 23 October 2012 at 22:47:40 UTC, Walter Bright wrote: On 10/22/2012 3:55 AM, Andrei Alexandrescu wrote: On 10/22/12 9:47 AM, Jens Mueller wrote: This is probably interesting for Phobos. But I'm not the one to make a decision. The core Phobos developers should decide. Hopefully

Re: [RFC] ColorD

2012-10-26 Thread Adam D. Ruppe
On Friday, 26 October 2012 at 06:08:39 UTC, Robik wrote: Yeah, the problem is it does not work in all terminals. Yeah, but neither will any other feature. But virtually every one used in practice nowadays supports it though.

Re: [RFC] ColorD

2012-10-26 Thread H. S. Teoh
On Fri, Oct 26, 2012 at 08:08:36AM +0200, Robik wrote: On Friday, 26 October 2012 at 01:35:43 UTC, Adam D. Ruppe wrote: On Thursday, 25 October 2012 at 22:27:52 UTC, Jens Mueller wrote: 5. setting the contents of the title bar The title bar of what? Here's how you do it on xterm:

Re: [RFC] ColorD

2012-10-26 Thread Jens Mueller
H. S. Teoh wrote: On Fri, Oct 26, 2012 at 08:08:36AM +0200, Robik wrote: On Friday, 26 October 2012 at 01:35:43 UTC, Adam D. Ruppe wrote: On Thursday, 25 October 2012 at 22:27:52 UTC, Jens Mueller wrote: 5. setting the contents of the title bar The title bar of what? Here's how you

Re: [RFC] ColorD

2012-10-26 Thread H. S. Teoh
On Fri, Oct 26, 2012 at 04:46:26PM +0200, Jens Mueller wrote: H. S. Teoh wrote: On Fri, Oct 26, 2012 at 08:08:36AM +0200, Robik wrote: On Friday, 26 October 2012 at 01:35:43 UTC, Adam D. Ruppe wrote: [...] writefln(\033]0;%s\007, title); Yeah, the problem is it does not work in

Re: [RFC] ColorD

2012-10-26 Thread Adam D. Ruppe
I'm slapping together a minimal termcap reader for D now.

Re: [RFC] ColorD

2012-10-26 Thread Adam D. Ruppe
Here we go, some more basic functions: http://arsdnet.net/dcode/terminal.d The unix stuff is more implemented than the windows. Let's walk through main and I'll discuss why I'm doing things the way I am. I'm throwing this out just to show one possible way this can be done and to explain why

Re: [RFC] ColorD

2012-10-26 Thread H. S. Teoh
On Fri, Oct 26, 2012 at 10:06:38AM +0200, Jens Mueller wrote: H. S. Teoh wrote: On Fri, Oct 26, 2012 at 12:27:38AM +0200, Jens Mueller wrote: Walter Bright wrote: [...] [...] 1. getting mouse input Anybody an idea how to this on Linux? You can only do this in terminals that

Re: [RFC] ColorD

2012-10-26 Thread H. S. Teoh
On Fri, Oct 26, 2012 at 01:56:28PM +0200, Tobias Pankrath wrote: On Tuesday, 23 October 2012 at 22:47:40 UTC, Walter Bright wrote: [...] A more comprehensive module that included: 1. getting mouse input 2. getting size of the console 3. moving the cursor around 4. drawing boxes in the

Re: [RFC] ColorD

2012-10-26 Thread Adam D. Ruppe
On Friday, 26 October 2012 at 18:05:09 UTC, H. S. Teoh wrote: If we implement an event loop, I think it should be optional. I think this is another benefit of capturing the input with a special type and method. auto input = terminal.captureInput(ConsoleInputFlags.raw |

Re: [RFC] ColorD

2012-10-25 Thread Jens Mueller
Walter Bright wrote: On 10/22/2012 3:55 AM, Andrei Alexandrescu wrote: On 10/22/12 9:47 AM, Jens Mueller wrote: This is probably interesting for Phobos. But I'm not the one to make a decision. The core Phobos developers should decide. Hopefully somebody is reading this. Off the top of

Re: [RFC] ColorD

2012-10-25 Thread H. S. Teoh
On Fri, Oct 26, 2012 at 12:27:38AM +0200, Jens Mueller wrote: Walter Bright wrote: [...] A module that only sets the console color is a little too light to be a phobos entry. A more comprehensive module that included: 1. getting mouse input Anybody an idea how to this on Linux?

Re: [RFC] ColorD

2012-10-25 Thread Adam D. Ruppe
On Thursday, 25 October 2012 at 22:27:52 UTC, Jens Mueller wrote: 5. setting the contents of the title bar The title bar of what? Here's how you do it on xterm: writefln(\033]0;%s\007, title); On Windows it is an api function:

Re: [RFC] ColorD

2012-10-25 Thread H. S. Teoh
On Fri, Oct 26, 2012 at 03:35:42AM +0200, Adam D. Ruppe wrote: On Thursday, 25 October 2012 at 22:27:52 UTC, Jens Mueller wrote: 5. setting the contents of the title bar The title bar of what? Here's how you do it on xterm: writefln(\033]0;%s\007, title); On Windows it is an api

Re: [RFC] ColorD

2012-10-24 Thread Robik
On Tuesday, 23 October 2012 at 22:47:40 UTC, Walter Bright wrote: On 10/22/2012 3:55 AM, Andrei Alexandrescu wrote: On 10/22/12 9:47 AM, Jens Mueller wrote: This is probably interesting for Phobos. But I'm not the one to make a decision. The core Phobos developers should decide. Hopefully

Re: [RFC] ColorD

2012-10-23 Thread Jens Mueller
Chad J wrote: On 10/22/2012 03:47 AM, Jens Mueller wrote: Chad J wrote: There is no weakness to this. The only shred of a counterargument I can think of is that it makes the format strings more difficult to learn. Other than that, it is possible to detect the destination of the formatter,

Re: [RFC] ColorD

2012-10-23 Thread Chad J
On 10/23/2012 03:51 AM, Jens Mueller wrote: Chad J wrote: On 10/22/2012 03:47 AM, Jens Mueller wrote: Chad J wrote: There is no weakness to this. The only shred of a counterargument I can think of is that it makes the format strings more difficult to learn. Other than that, it is possible to

Re: [RFC] ColorD

2012-10-23 Thread Philippe Sigaud
writefln(The %c(red,white)(widgetometer%) is a device formeasuring); // for writing red on white Would something like the following be possible? // col is a string-accepting function that returns a correctly formatted string // red and white are from a general Color enum alias col!(Color.red,

Re: [RFC] ColorD

2012-10-23 Thread Chad J
On 10/23/2012 03:56 PM, Philippe Sigaud wrote: writefln(The %c(red,white)(widgetometer%) is a device formeasuring); // for writing red on white Would something like the following be possible? // col is a string-accepting function that returns a correctly formatted string // red and white are

Re: [RFC] ColorD

2012-10-23 Thread Jens Mueller
Chad J wrote: On 10/23/2012 03:51 AM, Jens Mueller wrote: Chad J wrote: On 10/22/2012 03:47 AM, Jens Mueller wrote: Chad J wrote: There is no weakness to this. The only shred of a counterargument I can think of is that it makes the format strings more difficult to learn. Other than that,

Re: [RFC] ColorD

2012-10-23 Thread Jens Mueller
Jens Mueller wrote: Chad J wrote: On 10/23/2012 03:51 AM, Jens Mueller wrote: Chad J wrote: On 10/22/2012 03:47 AM, Jens Mueller wrote: Chad J wrote: There is no weakness to this. The only shred of a counterargument I can think of is that it makes the format strings more difficult to

Re: [RFC] ColorD

2012-10-23 Thread Chad J
On 10/23/2012 04:42 PM, Jens Mueller wrote: Jens Mueller wrote: Chad J wrote: That's a reasonable suggestion. The only thing that can't be solved is the trailing ) enclosing the text to be formatted. That needs a % before it to prevent ambiguity with parentheses in the text itself. So I

Re: [RFC] ColorD

2012-10-23 Thread Jens Mueller
Chad J wrote: On 10/23/2012 04:42 PM, Jens Mueller wrote: Jens Mueller wrote: Chad J wrote: That's a reasonable suggestion. The only thing that can't be solved is the trailing ) enclosing the text to be formatted. That needs a % before it to prevent ambiguity with parentheses in the text

Re: [RFC] ColorD

2012-10-23 Thread Walter Bright
On 10/22/2012 3:55 AM, Andrei Alexandrescu wrote: On 10/22/12 9:47 AM, Jens Mueller wrote: This is probably interesting for Phobos. But I'm not the one to make a decision. The core Phobos developers should decide. Hopefully somebody is reading this. Off the top of my head something that is

Re: [RFC] ColorD

2012-10-23 Thread Tim
On Tuesday, 23 October 2012 at 22:47:40 UTC, Walter Bright wrote: On 10/22/2012 3:55 AM, Andrei Alexandrescu wrote: On 10/22/12 A module that only sets the console color is a little too light to be a phobos entry. A more comprehensive module that included: 1. getting mouse input 2. getting

Re: [RFC] ColorD

2012-10-23 Thread H. S. Teoh
On Tue, Oct 23, 2012 at 03:46:37PM -0700, Walter Bright wrote: [...] A module that only sets the console color is a little too light to be a phobos entry. A more comprehensive module that included: 1. getting mouse input 2. getting size of the console 3. moving the cursor around 4.

Re: [RFC] ColorD

2012-10-23 Thread Adam D. Ruppe
On Tuesday, 23 October 2012 at 23:07:18 UTC, H. S. Teoh wrote: try, esp. if you're dealing with Unix terminals, which are many and varied, and have all sorts of idiosyncrasies that make it a pain to write a generic library that works for everything. Does anybody really care about everything?

Re: [RFC] ColorD

2012-10-23 Thread H. S. Teoh
On Wed, Oct 24, 2012 at 01:16:38AM +0200, Adam D. Ruppe wrote: On Tuesday, 23 October 2012 at 23:07:18 UTC, H. S. Teoh wrote: try, esp. if you're dealing with Unix terminals, which are many and varied, and have all sorts of idiosyncrasies that make it a pain to write a generic library that

Re: [RFC] ColorD

2012-10-22 Thread Jens Mueller
Chad J wrote: On 10/21/2012 06:55 PM, Jens Mueller wrote: Chad J wrote: On 10/21/2012 06:11 PM, Jens Mueller wrote: Chad J wrote: On 10/21/2012 05:01 PM, Jens Mueller wrote: It seems to have a hard ncurses/termcap/etc dependency. Yes. I think you cannot make it portable without. Please

Re: [RFC] ColorD

2012-10-22 Thread renoX
This could be improved, the example you give writeln(Colors.Red, Foo Bar, Colors.Reset); imply that if you forget to put Colors.Reset at the end of writeln then all the following call will be made in Colors.Red which I don't like, IMHO writeln(Colors.Red, Foo Bar); is better and at

Re: [RFC] ColorD

2012-10-22 Thread Robik
On Sunday, 21 October 2012 at 22:32:35 UTC, Walter Bright wrote: On 10/21/2012 12:28 PM, Robik wrote: Simple example: import std.stdio, colord; void main() { setConsoleColors(Fg.red, Bg.blue); writeln(Red text on blue background.); resetConsoleColors(); // Bring back

Re: [RFC] ColorD

2012-10-22 Thread Andrei Alexandrescu
On 10/22/12 9:47 AM, Jens Mueller wrote: This is probably interesting for Phobos. But I'm not the one to make a decision. The core Phobos developers should decide. Hopefully somebody is reading this. Off the top of my head something that is specific for only certain systems (Unixen in this

Re: [RFC] ColorD

2012-10-22 Thread Dejan Lekic
On Sunday, 21 October 2012 at 19:28:21 UTC, Robik wrote: Hello, I would like to introduce ColorD, small library that allows to simply manipulate console output colors, both on Windows and Posix operating systems. It also supports font styles such as underline and strikethrough(Posix feature

Re: [RFC] ColorD

2012-10-22 Thread Jens Mueller
Andrei Alexandrescu wrote: On 10/22/12 9:47 AM, Jens Mueller wrote: This is probably interesting for Phobos. But I'm not the one to make a decision. The core Phobos developers should decide. Hopefully somebody is reading this. Off the top of my head something that is specific for only

Re: [RFC] ColorD

2012-10-22 Thread Jens Mueller
Robik wrote: On Sunday, 21 October 2012 at 22:32:35 UTC, Walter Bright wrote: On 10/21/2012 12:28 PM, Robik wrote: Simple example: import std.stdio, colord; void main() { setConsoleColors(Fg.red, Bg.blue); writeln(Red text on blue background.);

Re: [RFC] ColorD

2012-10-22 Thread Adam D. Ruppe
On Monday, 22 October 2012 at 12:30:38 UTC, Jens Mueller wrote: But my research concluded that there is no such way on Posix. Yeah, if there was a way to get current colors, you wouldn't have to set environment variables for programs like vi to know if the background is light or dark. It's

Re: [RFC] ColorD

2012-10-22 Thread Andrei Alexandrescu
On 10/22/12 8:24 AM, Jens Mueller wrote: Andrei Alexandrescu wrote: On 10/22/12 9:47 AM, Jens Mueller wrote: This is probably interesting for Phobos. But I'm not the one to make a decision. The core Phobos developers should decide. Hopefully somebody is reading this. Off the top of my head

Re: [RFC] ColorD

2012-10-22 Thread Jens Mueller
Andrei Alexandrescu wrote: On 10/22/12 8:24 AM, Jens Mueller wrote: Andrei Alexandrescu wrote: On 10/22/12 9:47 AM, Jens Mueller wrote: This is probably interesting for Phobos. But I'm not the one to make a decision. The core Phobos developers should decide. Hopefully somebody is reading

Re: [RFC] ColorD

2012-10-22 Thread Kagamin
On Monday, 22 October 2012 at 12:26:29 UTC, Jens Mueller wrote: It also works on Windows. It's still more of a linux tradition. Implementing it as a separate package will be also a good exercise of writing a layer over Phobos I/O system.

Re: [RFC] ColorD

2012-10-22 Thread 1100110
On Mon, 22 Oct 2012 06:04:51 -0500, Dejan Lekic dejan.le...@gmail.com wrote: On Sunday, 21 October 2012 at 19:28:21 UTC, Robik wrote: Hello, I would like to introduce ColorD, small library that allows to simply manipulate console output colors, both on Windows and Posix operating

Re: [RFC] ColorD

2012-10-22 Thread Chad J
On 10/22/2012 03:47 AM, Jens Mueller wrote: Chad J wrote: There is no weakness to this. The only shred of a counterargument I can think of is that it makes the format strings more difficult to learn. Other than that, it is possible to detect the destination of the formatter, so color codes

[RFC] ColorD

2012-10-21 Thread Robik
Hello, I would like to introduce ColorD, small library that allows to simply manipulate console output colors, both on Windows and Posix operating systems. It also supports font styles such as underline and strikethrough(Posix feature only). Simple example: import std.stdio, colord; void

Re: [RFC] ColorD

2012-10-21 Thread Peter Sommerfeld
Robik wrote: I would like to introduce ColorD, small library that allows to simply manipulate console output colors, both on Windows and Posix operating systems. GitHub: https://github.com/robik/ColorD On windows I got an error: Not a property EnumTypedef!color,fg.opDispatch Same for

Re: [RFC] ColorD

2012-10-21 Thread Robik
On Sunday, 21 October 2012 at 20:19:54 UTC, Peter Sommerfeld wrote: Robik wrote: I would like to introduce ColorD, small library that allows to simply manipulate console output colors, both on Windows and Posix operating systems. GitHub: https://github.com/robik/ColorD On windows I got

Re: [RFC] ColorD

2012-10-21 Thread bearophile
Robik: GitHub: https://github.com/robik/ColorD Maybe it'ìs better to call it ConsoleColorsD, or something. ColorD seems more fit for a (handy) library about color theory, color space conversions, etc. Bye, bearophile

Re: [RFC] ColorD

2012-10-21 Thread F i L
Robik wrote: Hello, I would like to introduce ColorD, small library that allows to simply manipulate console output colors, both on Windows and Posix operating systems. It also supports font styles such as underline and strikethrough(Posix feature only). It might be nice to have a

Re: [RFC] ColorD

2012-10-21 Thread Robik
On Sunday, 21 October 2012 at 20:39:31 UTC, bearophile wrote: Robik: GitHub: https://github.com/robik/ColorD Maybe it'ìs better to call it ConsoleColorsD, or something. ColorD seems more fit for a (handy) library about color theory, color space conversions, etc. Bye, bearophile Moved

Re: [RFC] ColorD

2012-10-21 Thread Jens Mueller
Robik wrote: Hello, I would like to introduce ColorD, small library that allows to simply manipulate console output colors, both on Windows and Posix operating systems. It also supports font styles such as underline and strikethrough(Posix feature only). Simple example: import

Re: [RFC] ColorD

2012-10-21 Thread Robik
On Sunday, 21 October 2012 at 21:01:21 UTC, Jens Mueller wrote: Interesting looks solid to me. Some nit-picks: * Coloring on Posix depends a ANSI terminal. Can you check that a terminal is ANSI compatible? Sure, why not. * There are some magic numbers in the code. These may be difficult to

Re: [RFC] ColorD

2012-10-21 Thread Jens Mueller
Robik wrote: On Sunday, 21 October 2012 at 21:01:21 UTC, Jens Mueller wrote: Interesting looks solid to me. Some nit-picks: * Coloring on Posix depends a ANSI terminal. Can you check that a terminal is ANSI compatible? Sure, why not. Do you know how to do this? * There are some magic

Re: [RFC] ColorD

2012-10-21 Thread Era Scarecrow
On Sunday, 21 October 2012 at 19:28:21 UTC, Robik wrote: I would like to introduce ColorD, small library that allows to simply manipulate console output colors, both on Windows and Posix operating systems. It also supports font styles such as underline and strikethrough(Posix feature only).

Re: [RFC] ColorD

2012-10-21 Thread Jens Mueller
Era Scarecrow wrote: On Sunday, 21 October 2012 at 19:28:21 UTC, Robik wrote: I would like to introduce ColorD, small library that allows to simply manipulate console output colors, both on Windows and Posix operating systems. It also supports font styles such as underline and

Re: [RFC] ColorD

2012-10-21 Thread Robik
On Sunday, 21 October 2012 at 21:25:14 UTC, Era Scarecrow wrote: On Sunday, 21 October 2012 at 19:28:21 UTC, Robik wrote: I would like to introduce ColorD, small library that allows to simply manipulate console output colors, both on Windows and Posix operating systems. It also supports font

Re: [RFC] ColorD

2012-10-21 Thread Chad J
On 10/21/2012 05:01 PM, Jens Mueller wrote: Robik wrote: Hello, I would like to introduce ColorD, small library that allows to simply manipulate console output colors, both on Windows and Posix operating systems. It also supports font styles such as underline and strikethrough(Posix feature

Re: [RFC] ColorD

2012-10-21 Thread Peter Sommerfeld
Am 21.10.2012, 22:24 Uhr, schrieb Robik szad...@gmail.com: On Sunday, 21 October 2012 at 20:19:54 UTC, Peter Sommerfeld wrote: Robik wrote: I would like to introduce ColorD, small library that allows to simply manipulate console output colors, both on Windows and Posix operating systems.

Re: [RFC] ColorD

2012-10-21 Thread Jens Mueller
Chad J wrote: On 10/21/2012 05:01 PM, Jens Mueller wrote: Robik wrote: Hello, I would like to introduce ColorD, small library that allows to simply manipulate console output colors, both on Windows and Posix operating systems. It also supports font styles such as underline and

Re: [RFC] ColorD

2012-10-21 Thread Walter Bright
On 10/21/2012 12:28 PM, Robik wrote: Simple example: import std.stdio, colord; void main() { setConsoleColors(Fg.red, Bg.blue); writeln(Red text on blue background.); resetConsoleColors(); // Bring back initial state } Need a method to get the current state, and reset the

Re: [RFC] ColorD

2012-10-21 Thread Chad J
On 10/21/2012 06:11 PM, Jens Mueller wrote: Chad J wrote: On 10/21/2012 05:01 PM, Jens Mueller wrote: It seems to have a hard ncurses/termcap/etc dependency. Yes. I think you cannot make it portable without. Please proof me wrong and I'll fix this. Well, traditionally it's done with

Re: [RFC] ColorD

2012-10-21 Thread Chad J
Additionally note that the format syntax handles Walter's concerns here: http://forum.dlang.org/post/k61t63$pi4$1...@digitalmars.com The color format syntax uses a pair of matched parentheses, and thus makes it impossible to leave the console in a different state than when the formatting call

Re: [RFC] ColorD

2012-10-21 Thread Jens Mueller
Chad J wrote: On 10/21/2012 06:11 PM, Jens Mueller wrote: Chad J wrote: On 10/21/2012 05:01 PM, Jens Mueller wrote: It seems to have a hard ncurses/termcap/etc dependency. Yes. I think you cannot make it portable without. Please proof me wrong and I'll fix this. Well, traditionally

Re: [RFC] ColorD

2012-10-21 Thread Jens Mueller
Walter Bright wrote: On 10/21/2012 12:28 PM, Robik wrote: Simple example: import std.stdio, colord; void main() { setConsoleColors(Fg.red, Bg.blue); writeln(Red text on blue background.); resetConsoleColors(); // Bring back initial state } Need a method to get

Re: [RFC] ColorD

2012-10-21 Thread Chad J
On 10/21/2012 06:55 PM, Jens Mueller wrote: Chad J wrote: On 10/21/2012 06:11 PM, Jens Mueller wrote: Chad J wrote: On 10/21/2012 05:01 PM, Jens Mueller wrote: It seems to have a hard ncurses/termcap/etc dependency. Yes. I think you cannot make it portable without. Please proof me wrong

Re: [RFC] ColorD

2012-10-21 Thread 1100110
On Sun, 21 Oct 2012 17:32:41 -0500, Chad J chadjoan@__spam.is.bad__gmail.com.is.bad__gmail.com.com wrote: On 10/21/2012 06:11 PM, Jens Mueller wrote: Chad J wrote: On 10/21/2012 05:01 PM, Jens Mueller wrote: It seems to have a hard ncurses/termcap/etc dependency. Yes. I think you cannot