Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

rgb to console color

int index = (c.R > 128 | c.G > 128 | c.B > 128) ? 8 : 0;
                index |= (c.R > 64) ? 4 : 0; 
                index |= (c.G > 64) ? 2 : 0; 
                index |= (c.B > 64) ? 1 : 0; 
                Console.ForegroundColor = (System.ConsoleColor)index;
 
PREVIOUS NEXT
Tagged: #rgb #console #color
ADD COMMENT
Topic
Name
9+2 =