Jump to page: 1 29  
Page
Thread overview
[RFC] ColorD
Oct 21, 2012
Robik
Oct 21, 2012
Peter Sommerfeld
Oct 21, 2012
Robik
Oct 21, 2012
Peter Sommerfeld
Oct 21, 2012
bearophile
Oct 21, 2012
Robik
Oct 21, 2012
F i L
Oct 22, 2012
renoX
Oct 21, 2012
Jens Mueller
Oct 21, 2012
Robik
Oct 21, 2012
Jens Mueller
Oct 21, 2012
Chad J
Oct 21, 2012
Jens Mueller
Oct 21, 2012
Chad J
Oct 21, 2012
Chad J
Oct 21, 2012
Jens Mueller
Oct 21, 2012
Chad J
Oct 22, 2012
Jens Mueller
Oct 22, 2012
Jens Mueller
Oct 22, 2012
Jens Mueller
Oct 22, 2012
Kagamin
Oct 23, 2012
Walter Bright
Oct 23, 2012
Tim
Oct 23, 2012
H. S. Teoh
Oct 23, 2012
Adam D. Ruppe
Oct 23, 2012
H. S. Teoh
Oct 24, 2012
Robik
Oct 25, 2012
Jens Mueller
Oct 26, 2012
Adam D. Ruppe
Oct 26, 2012
H. S. Teoh
Oct 26, 2012
Adam D. Ruppe
Oct 26, 2012
Robik
Oct 26, 2012
Adam D. Ruppe
Oct 26, 2012
H. S. Teoh
Oct 26, 2012
Jens Mueller
Oct 26, 2012
H. S. Teoh
Oct 26, 2012
Adam D. Ruppe
Oct 26, 2012
Adam D. Ruppe
Oct 28, 2012
Jens Mueller
Oct 26, 2012
Jens Mueller
Oct 29, 2012
Walter Bright
Oct 25, 2012
H. S. Teoh
Oct 26, 2012
Jens Mueller
Oct 26, 2012
Tobias Pankrath
Oct 26, 2012
H. S. Teoh
Oct 26, 2012
Adam D. Ruppe
Oct 27, 2012
Adam D. Ruppe
Oct 28, 2012
Adam D. Ruppe
Oct 28, 2012
H. S. Teoh
Oct 28, 2012
Jens Mueller
Oct 28, 2012
Adam D. Ruppe
Oct 28, 2012
Jens Mueller
Oct 28, 2012
Adam D. Ruppe
Oct 28, 2012
H. S. Teoh
Oct 28, 2012
Adam D. Ruppe
Oct 28, 2012
Adam D. Ruppe
Oct 28, 2012
Jens Mueller
Oct 28, 2012
Tobias Pankrath
Oct 26, 2012
H. S. Teoh
Oct 23, 2012
Chad J
Oct 23, 2012
Jens Mueller
Oct 23, 2012
Chad J
Oct 23, 2012
Philippe Sigaud
Oct 23, 2012
Chad J
Oct 23, 2012
Jens Mueller
Oct 23, 2012
Jens Mueller
Oct 23, 2012
Chad J
Oct 23, 2012
Jens Mueller
Oct 22, 2012
1100110
Oct 21, 2012
Era Scarecrow
Oct 21, 2012
Robik
Oct 21, 2012
Jens Mueller
Oct 21, 2012
Walter Bright
Oct 21, 2012
Jens Mueller
Oct 22, 2012
Robik
Oct 22, 2012
Jens Mueller
Oct 22, 2012
Adam D. Ruppe
Oct 22, 2012
Dejan Lekic
Oct 22, 2012
1100110
Oct 28, 2012
nazriel
October 21, 2012
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 main()
{
    setConsoleColors(Fg.red, Bg.blue);
    writeln("Red text on blue background.");
    resetConsoleColors(); // Bring back initial state
}


Feedback welcome.

GitHub: https://github.com/robik/ColorD

Regards.
October 21, 2012
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 "bg".

void resetConsoleColors()
{
    setConsoleColors(Fg.initial, Bg.initial); // here
}

Peter
October 21, 2012
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 an error:
> Not a property <EnumTypedef!<color,"fg">>.opDispatch
> Same for "bg".
>
> void resetConsoleColors()
> {
>     setConsoleColors(Fg.initial, Bg.initial); // here
> }
>
> Peter

What version are you using?
October 21, 2012
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
October 21, 2012
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 solution which works better with native writeln(), aka, something like:

    import std.stdio, colord;

    void main() {
        writeln(Colors.Red, "Foo Bar", Colors.Reset);
    }

October 21, 2012
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 to https://github.com/robik/ConsoleD
October 21, 2012
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 std.stdio, colord;
> void main()
> {
>     setConsoleColors(Fg.red, Bg.blue);
>     writeln("Red text on blue background.");
>     resetConsoleColors(); // Bring back initial state
> }
> 
> 
> Feedback welcome.
> 
> GitHub: https://github.com/robik/ColorD

Interesting looks solid to me.
Some nit-picks:
* Coloring on Posix depends a ANSI terminal. Can you check that a
  terminal is ANSI compatible?
* There are some magic numbers in the code. These may be difficult to
  figure out for maintaining.
* enum Color should maybe be same on all systems.
  This is a rather small issue. But I may transfer the Color to another
  system. So if it is possible there should only be one enum Color for
  all systems.
* Call it terminal or similar. Because other terminal related stuff can
  be added and IMHO it's a better name.

I have written a similar library. Not finished. Let's join forces. https://github.com/jkm/terminal

Johannes Pfau has written a progress bar. I will add this.

Jens
October 21, 2012
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
>   figure out for maintaining.

I will fix this.

> * enum Color should maybe be same on all systems.
>   This is a rather small issue. But I may transfer the Color to another
>   system. So if it is possible there should only be one enum Color for
>   all systems.

I think that this will only complicate the code.

> * Call it terminal or similar. Because other terminal related stuff can
>   be added and IMHO it's a better name.

It got renamed to ConsoleD.

> I have written a similar library. Not finished. Let's join forces.
> https://github.com/jkm/terminal
>
> Johannes Pfau has written a progress bar. I will add this.
>
> Jens

Sure, I'm interested in joining forces. Do you have IRC?


October 21, 2012
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 numbers in the code. These may be difficult to
> >  figure out for maintaining.
> 
> I will fix this.
> 
> >* enum Color should maybe be same on all systems.
> >  This is a rather small issue. But I may transfer the Color to
> >another
> >  system. So if it is possible there should only be one enum Color
> >for
> >  all systems.
> 
> I think that this will only complicate the code.

Probably not worth the trouble. But it should be documented.

> >* Call it terminal or similar. Because other terminal related stuff can
> >  be added and IMHO it's a better name.
> 
> It got renamed to ConsoleD.

But the module should not be named colsoled. Because it's a D module anyway. Call it just console.

> >I have written a similar library. Not finished. Let's join forces. https://github.com/jkm/terminal
> >
> >Johannes Pfau has written a progress bar. I will add this.
> >
> >Jens
> 
> Sure, I'm interested in joining forces. Do you have IRC?

Yes, I do.

Jens
October 21, 2012
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).

 Does this rely on nCurses? (or similar)
« First   ‹ Prev
1 2 3 4 5 6 7 8 9