Minicom black background color is not respected
Black will be "gray" on some terminals, not others, due to differences in color palettes. Minicom is using the curses support for eight ANSI colors. There is no standard for the actual colors used. "ANSI" (actually ECMA-48) only gives the names of the colors, for given numbers.
Users of both gnome-terminal and konsole have noticed that their "black" background is actually gray. Apparently their developers did this to make the terminal look nicer on the desktop; no consideration was made for actually using the terminal. xterm and rxvt use black (or white, depending on resource settings). For the former, you can usually edit your profile preferences and change the palette color assignments.
Here are sample screenshots from my Debian 7 machine to illustrate the differences you may see:
First, xterm
then gnome-terminal
and konsole:
Further reading:
- Can I set a color by its number?
- I don't like that shade of blue
- ECMA-48: Control Functions for Coded Character Sets
But that is only part of the story. Minicom was originally written to be specific to the Linux console. Those terminals can display 8 foreground and 8 background colors. But they do something interesting with the bold attribute:
- a bold foreground color is brighter
- a bold background also may be brighter.
The source-code isn't particularly sophisticated, and it draws colors and attributes (such as bold) assuming that they are independent of each other. It does not use ncurses. If it did, it (via ncurses) would pay attention to the ncv
capability. Quoting from terminfo(5):
no_color_video ncv NC video attributes
that cannot be used
with colors
and
On some color terminals, colors collide with highlights. You can reg‐
ister these collisions with the ncv capability. This is a bit-mask of
attributes not to be used when colors are enabled. The correspondence
with the attributes understood by curses is as follows:
Attribute Bit Decimal
A_STANDOUT 0 1
A_UNDERLINE 1 2
A_REVERSE 2 4
A_BLINK 3 8
A_DIM 4 16
A_BOLD 5 32
A_INVIS 6 64
A_PROTECT 7 128
A_ALTCHARSET 8 256
For example, on many IBM PC consoles, the underline attribute collides
with the foreground color blue and is not available in color mode.
These should have an ncv capability of 2.
If you use infocmp
to see, the "linux" terminal description uses ncv
:
linux|linux console,
am, bce, ccc, eo, mir, msgr, xenl, xon,
colors#8, it#8, ncv#18, pairs#64,
which is (again) part of the story (you may notice bold is not encoded in ncv
here). ncurses also orders the updates to the screen to keep from accidentally making a bold background — to handle the Linux console properly.
List of ANSI color escape sequences
The ANSI escape sequences you're looking for are the Select Graphic Rendition subset. All of these have the form
\033[XXXm
where XXX
is a series of semicolon-separated parameters.
To say, make text red, bold, and underlined (we'll discuss many other options below) in C you might write:
printf("\033[31;1;4mHello\033[0m");
In C++ you'd use
std::cout<<"\033[31;1;4mHello\033[0m";
In Python3 you'd use
print("\033[31;1;4mHello\033[0m")
and in Bash you'd use
echo -e "\033[31;1;4mHello\033[0m"
where the first part makes the text red (31
), bold (1
), underlined (4
) and the last part clears all this (0
).
As described in the table below, there are a large number of text properties you can set, such as boldness, font, underlining, &c.
Font Effects
Code | Effect | Note |
---|---|---|
0 | Reset / Normal | all attributes off |
1 | Bold or increased intensity | |
2 | Faint (decreased intensity) | Not widely supported. |
3 | Italic | Not widely supported. Sometimes treated as inverse. |
4 | Underline | |
5 | Slow Blink | less than 150 per minute |
6 | Rapid Blink | MS-DOS ANSI.SYS; 150+ per minute; not widely supported |
7 | [[reverse video]] | swap foreground and background colors |
8 | Conceal | Not widely supported. |
9 | Crossed-out | Characters legible, but marked for deletion. Not widely supported. |
10 | Primary(default) font | |
11–19 | Alternate font | Select alternate font n-10 |
20 | Fraktur | hardly ever supported |
21 | Bold off or Double Underline | Bold off not widely supported; double underline hardly ever supported. |
22 | Normal color or intensity | Neither bold nor faint |
23 | Not italic, not Fraktur | |
24 | Underline off | Not singly or doubly underlined |
25 | Blink off | |
27 | Inverse off | |
28 | Reveal | conceal off |
29 | Not crossed out | |
30–37 | Set foreground color | See color table below |
38 | Set foreground color | Next arguments are 5;<n> or 2;<r>;<g>;<b> , see below |
39 | Default foreground color | implementation defined (according to standard) |
40–47 | Set background color | See color table below |
48 | Set background color | Next arguments are 5;<n> or 2;<r>;<g>;<b> , see below |
49 | Default background color | implementation defined (according to standard) |
51 | Framed | |
52 | Encircled | |
53 | Overlined | |
54 | Not framed or encircled | |
55 | Not overlined | |
60 | ideogram underline | hardly ever supported |
61 | ideogram double underline | hardly ever supported |
62 | ideogram overline | hardly ever supported |
63 | ideogram double overline | hardly ever supported |
64 | ideogram stress marking | hardly ever supported |
65 | ideogram attributes off | reset the effects of all of 60-64 |
90–97 | Set bright foreground color | aixterm (not in standard) |
100–107 | Set bright background color | aixterm (not in standard) |
pyside QPushButton toggle background color
You have to use the pseudo-state checked:
import sys
from PySide import QtGui
if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
button = QtGui.QPushButton("Hello world")
button.setCheckable(True)
button.setStyleSheet("""
QPushButton {background:rgb(65,66,66); color: white;}
QPushButton::checked{background:rgb(255, 0, 0); color: white;}
""")
button.show()
sys.exit(app.exec_())
Setting background to GroupTableViewBackgroundColor
i have used this on my current project & it works fine i have xcode 4.0 & simulator 4.3
i have found on net that it is deprecated on ios 6
i have used like this
[self.tableview setBackgroundColor:[UIColor groupTableViewBackgroundColor]];
just have look at this link is groupTableViewBackgroundColor deprecated on iOS 6?
for alternative you can find out same image as UItableview Grouped style background on internet.
Does it help in terms of speed to use color: #000 instead of color: black
My guess would be that the hex code is slightly faster because the browser doesn't have to look up and translate the word.
You can check this unofficial test http://www.webmasterworld.com/css/4151070.htm?highlight=msg4158590, which supports the idea that it doesn't really make a noticeable difference :]
Codename one Dark style status bar on App
Check out the colors.xml
file mentioned here: https://www.codenameone.com/manual/advanced-topics.html
Just place it in the native/android
folder to define the colors of your app for the status bar:
<resources>
<color name="colorPrimary">#ff00ff00</color>
<color name="colorPrimaryDark">#80ff0000</color>
<color name="colorAccent">#800000ff</color>
</resources>
For iOS the build hint: ios.statusBarFG=UIStatusBarStyleLightContent
should work.
Unable to remove margin/padding above and below a p element
This is what is making margin:
.site-header-cart .widget_shopping_cart .woocommerce-mini-cart__empty-message {
margin: 1.41575em;
}
Location: https://store.ashenglowgaming.com/wp-content/cache/jch-optimize/b0effbedde43bc37217434081fca7177_2.css
To make them black remove margin and add padding instead:
.site-header-cart .widget_shopping_cart .woocommerce-mini-cart__empty-message {
margin: 0;
padding: 1.41575em;
}
Related Topics
Learning Kernel Hacking and Embedded Development at Home
In Unix, How to Run 'Make' in a Directory Without Cd'Ing to That Directory First
Graphical Diff Programs for Linux
How to Measure Separate CPU Core Usage for a Process
How to Get a List of Programs Running with Nohup
How to Delete Multiple Files at Once in Bash on Linux
Are Message Queues Obsolete in Linux
How to Base64 Encode Image in Linux Bash/Shell
Colored Shell Script Output Library
Bash Script to Calculate Time Elapsed
How to Move All Files Including Hidden Files into Parent Directory via *
Any Way to Exit Bash Script, But Not Quitting the Terminal
Looking for Files Not Owned by a Specific User
Check Free Disk Space for Current Partition in Bash
Excluding Directory When Creating a .Tar.Gz File
How to Pipe or Redirect the Output of Curl -V
Using a Remote Host's Usb Port as Local Usb (Linux and Windows)