c# - Representing colors -


I am currently trying to create some type of graphical interface framework, such as consoles and terminal emulators, but more A more declarative approach, though I have been giving headache to me for a few days, stumpled on anything: color .

What I'm curious to do is a way of representing colors with color as well as basic implementation and planning ( ANSI , indexed , < Em> 24-bit for VGA, xterm, Windows ..) My initial idea was to create a simple structure that represents one color in RGB color space:

 < Code> public structure color {public byte r, g, b; }  

... and a predefined color such as colored black = new color (0, 0, 0) for public static reading; will not work as Red on xterm is not red as in Windows Console then I thought of using the enum , but here I am unable to determine how much color is actually in value.

What would be a possible way of obtaining this? Are there other color spaces which RGB ?

In addition, it would be nice if they could be coalition like: color yellow = color green. Does it mean any kind?

If the color is only an integer, then the color. Yellow == color Color works without any additional code. (This is equal to 0xFFFF00 == 0xFF0000 | 0x00FF00) If you want color to have different R, G and B properties, then you can overloading some fancy operators and it can still work.

What I'm looking forward to is one way to represent the underlying implementation and planning (ANSI, indexed, 24-bit VGA, xterm, Windows ..) with colors independently Only color palettes My initial idea was to create a simple structure that represents a color in RGB color space:

...

Are there other colored spaces that represent the colors Could be more suitable for RGB?

I am a fan of this:

This explains why:


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -