Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I customize the colors used by 'jq -C'?

How do I specify colors other than the defaults used for jq --color-output?

like image 775
orome Avatar asked Jul 14 '18 12:07

orome


People also ask

How to change colour using jQuery?

To change the text color with jQuery, use the jQuery css() method. The color css property is used to change text color.

How can change P tag color in jQuery?

$("p"). on("mouseover", function() { $(this). css("color", "red"); }); Example: In this example, the paragraph element will change to red whenever the user hovers over it.

How would you set the text color of all titles to red with jQuery?

Place the following in your jQuery mouseover event handler: $(this). css('color', 'red');

How do you color text in JavaScript?

To change the font color of a HTML Element using JavaScript, get reference to this HTML element, and assign required color value to the element. style. color property. In the following example, we will change the font color of HTML Element with id "myElement" to the color "#FF0000" , in JavaScript, using element.


1 Answers

Support for the JQ_COLORS environment variable was added to the development version on April 29, 2017 (that is, after the release of jq 1.5), with the following documentation:

To configure alternative colors just set the JQ_COLORS environment variable to colon-delimited list of partial terminal escape sequences like "1;31", in this order:

- color for `null`
- color for `false`
- color for `true`
- color for numbers
- color for strings
- color for arrays
- color for objects

The default color scheme is the same as setting "JQ_COLORS=1;30:0;39:0;39:0;39:0;32:1;39:1;39".

This is not a manual for VT100/ANSI escapes. However, each of these color specifications should consist of two numbers separated by a semi-colon, where the first number is one of these:

- 1 (bright)
- 2 (dim)
- 4 (underscore)
- 5 (blink)
- 7 (reverse)
- 8 (hidden)

and the second is one of these:

- 30 (black)
- 31 (red)
- 32 (green)
- 33 (yellow)
- 34 (blue)
- 35 (magenta)
- 36 (cyan)
- 37 (white)
like image 52
peak Avatar answered Sep 20 '22 00:09

peak