Minicom Black Background Color Is Not Respected

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

screenshot of xterm

then gnome-terminal

screenshot of gnome-terminal

and konsole:

screenshot of 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




















































































































































































































CodeEffectNote
0Reset / Normalall attributes off
1Bold or increased intensity
2Faint (decreased intensity)Not widely supported.
3ItalicNot widely supported. Sometimes treated as inverse.
4Underline
5Slow Blinkless than 150 per minute
6Rapid BlinkMS-DOS ANSI.SYS; 150+ per minute; not widely supported
7[[reverse video]]swap foreground and background colors
8ConcealNot widely supported.
9Crossed-outCharacters legible, but marked for deletion. Not widely supported.
10Primary(default) font
11–19Alternate fontSelect alternate font n-10
20Frakturhardly ever supported
21Bold off or Double UnderlineBold off not widely supported; double underline hardly ever supported.
22Normal color or intensityNeither bold nor faint
23Not italic, not Fraktur
24Underline offNot singly or doubly underlined
25Blink off
27Inverse off
28Revealconceal off
29Not crossed out
30–37Set foreground colorSee color table below
38Set foreground colorNext arguments are 5;<n> or 2;<r>;<g>;<b>, see below
39Default foreground colorimplementation defined (according to standard)
40–47Set background colorSee color table below
48Set background colorNext arguments are 5;<n> or 2;<r>;<g>;<b>, see below
49Default background colorimplementation defined (according to standard)
51Framed
52Encircled
53Overlined
54Not framed or encircled
55Not overlined
60ideogram underlinehardly ever supported
61ideogram double underlinehardly ever supported
62ideogram overlinehardly ever supported
63ideogram double overlinehardly ever supported
64ideogram stress markinghardly ever supported
65ideogram attributes offreset the effects of all of 60-64
90–97Set bright foreground coloraixterm (not in standard)
100–107Set bright background coloraixterm (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



Leave a reply



Submit