+ 2
Help - Color Problem in CppDroid
Im currently trying to get a hang of ANSI escape sequences as ncurses library is not there in CppDroid, but the basic linux functions seems to work there... So I tried these codes: #include<iostream> using namespace std; int main() { cout<<"\033[30;43mHello"; } This printed Black Text on a Yellow Background, exactly what I wanted. Now I applied bold as well using 1; But in this: #include<iostream> using namespace std; int main() { cout<<"\033[1;30;43mHello"; } The text is shown in gray color. Why?
8 odpowiedzi
+ 5
Look at this
http://www.cplusplus.com/forum/unices/36461/
+ 4
I don't know how it works but i tried with it.
#include <iostream>
#include <sstream>
// cout << "\033[1;30;45mWord" << endl;
using namespace std;
int main()
{
for(int i=0 ; i<101 ; i++)
{
for(int j=0 ; j<101 ; j++)
{
stringstream ss;
ss << "\033[" << i << ";" << j << "mWord" << endl;
cout << i << "\t" << j << "\t" << ss.str() << endl;
}
}
return 0;
}
This is fuckin magic
+ 4
Thank You!
+ 4
"\033[1;30;7;32m"
try with it ;)
+ 4
Its working!
Thank You!
+ 3
@Kinshuk Vasishit
On the page is
" \033[1;#m - makes colored text bold** "
and then
**(this could be usefull for those who want more colors. The efect given by bold will give a color change effect)
so color of the text is other
+ 3
Yes I understood that.
But if black is changed to dark gray, is there some color which is changed to black?
Ill try with the loops then.
Thank you Again!
+ 2
Unfortunately, my problem is still unsolved...
But the link you shared has the explanation that bold manipulates colors to some extent.
So, now, Is there a way to maintain the black color with bold, without letting it change to gray?