I am trying to add color the the jquery terminal like a bash terminal in linux.
I have tried the same arrangement of color codes
\033]01;31\] # pink
\033]00m\] # white
\033]01;36\] # bold green
\033]02;36\] # green
\033]01;34\] # blue
\033]01;33\] # bold yellow
and there is no color options.
A function I use is like so for javascript
function teal(message) {
return "[[gb;teal;black]" + message + "]";
}
Just wrap the string like the above.
The first colour is the text color and the second color is the background.
The gb at the start are for string formatting;
g = glow & b = bold
You can also under line and make them italic aswell
i = italic & u = underline
In the string, make sure not to have any [ or ] as this will affect the formatting. Use the escape character \[ or \] and it should work.
It will also work in C# as I have done this myself and should see no reason it wouldn't work with the likes of Java strings either.
Related
Very simple stuff. I want a function, say function f, to be plotted with a particular color. I also want a piece of label saying "function f color" which is also displayed in that color.
I am trying this so far:
set style line 1 lw 3 lc 1
set label "AC" at 0, 70 textcolor 1
but apparently the "lc" and "textcolor" follows different specs, and it complains:
"trolo4.pl", line 8: colorspec option not recognized
any help would be great!
Try this instead:
set label "AC" at 0, 70 textcolor linetype 1
or
set label "AC" at 0, 70 textcolor linespec 1
Read the manual in gnuplot> help label to learn more.
The answer by #holygeek works fine. Coming from python, I find that it is often nice to be a little more explicit.
set style line 1 lw 1 lc rgb "red"
set label "AC" at 0, 70 tc rgb "red"
Note that the set of color names recognized by your gnuplot is system dependent (see show colornames for a complete list). To achieve complete system independence, you can use the #RRGGBB version. e.g. red is '#ff0000, green is #00ff00 and blue is #0000ff. of course, you can make up all sorts of interesting colors (again, see show colornames for a list of pre-defined colors and their equivalent #.....)
for more info, also see help colorspec
On setting certain foregroundColor, I'm gettting a inner shadow on the text - no other attributes are set.
span = new spanModule.Span();
span.foregroundColor = new colorModule.Color("green");
span.text = "test";
formattedString.spans.push(span);
Funny thing is that it happens with certain colors only.
So far, cyan, blue and green.
This is on Android - not tested on iOS.
In the image both "10" and "D" are part of the same formattedString but different spans - the difference is the foregroundColor and in the "D" the fontSize has been set. Actually if I change the color of the "D" to cyan also - there's a shadow. Even if I take out the fontSize.
I've seen the discussion in https://www.ibm.com/developerworks/community/forums/html/topic?id=7981c520-ee1b-4a5f-b1f7-510172d2a3bd&ps=25 and have a copy of the GalacticSolutions Excel export script. That script takes the color of the font in a module cell and maps it to the Excel cell-fill color. What isn't clear to me is how to take that same source color and map it instead to the Excel cell's text color.
My source attribute is an enumeration with the assigned colors setting the font color as in . Perhaps the simplest answer that would help me is if someone familiar with the GalacticSolutions script , , could identify the code which passes the color to the cell fill-color and provide the equivalent command to handle the font color.
thanks
Carl
I received an answer on an IBM forum and am copying it here.
dowhich = "Interior" //to shade the cell
dowhich = "Font" //to color the font
void excelSetRangeColorOLE( OleAutoObj objExcelRange, int iRGBValue ) { OleAutoObj objExcelInterior = null oleResult( oleGet( objExcelRange, dowhich, objExcelInterior ) ) oleResult( olePut( objExcelInterior, "Color", iRGBValue ) ) }
I have lots of files to generate a plot for and therefore wrote a little script for gnuplot.
I want to add additional information with a label underneath the graph but my label is not displayed on the generated image.
Anyone gut an idea?
load.plt:
# template.gnuplot
set terminal png
filename = "results-05112012-".i.".dat"
plotfile = "results-05112012-".i.".png"
print filename." ".plotfile
set grid
set title "EER""
set output plotfile
set label "m = 20" at 0, 3 front tc rgb "#ffffff"
plot[0.35:0.75][0:100] filename using 1:6 title "FAR" w lp, filename using 1:7 title "FRR" w lp
unset output
unset label
i=i+1
if(i <= n) reread
I can see two reasons why the label might not appear. One is that the label is at the point (0,3) which is not within the plot region [0.35:0.75][0:100]. The other is that the label is white in color (#ffffff).
I am using jqplot to draw multiple lines of different line colors.
Also, I have legends whose colors should be in accordance with the corresponding line colors.
I seem to find no way to cope with the legend color.
So any hint?
Taken from the question title I understand you want to change the color of legend labels to correspond to the color of series, right?
For this reason, since the swatches which are just in front of the labels, we can use them to grab the color which we then set for the labels.
This is the bit of the code you need. You need to remember to put it before you draw your plot.
$.jqplot.postDrawHooks.push(function() {
var swatches = $('table.jqplot-table-legend tr td.jqplot-table-legend-swatch');
var labels = $('table.jqplot-table-legend tr td.jqplot-table-legend-label');
labels.each(function(index) {
//turn the label's text color to the swatch's color
var color = $(swatches[index]).find("div div").css('background-color');
$(this).css('color',color );
});
});
You could see the code running live here.