Set global text color? - latex

I know that to use color in a document you have to load the package "color". But I can only find documentation on how to define color for a given part of the document... not what I want to do. What I do want is to define a global text color, that is used per default.
Is this possible? Can anyone tell me how to do this?

If you use, for example
\color{red}
in your preamble, before \begin{document}, then the text should be red throughout your document unless you override with another \color declaration.

Related

Changing bullet style (e.g. color) using Google Docs API

I want to change style of bullet without changing text style. I tried updateTextStyle, but it works for whole text with bullet, also I noticed, that bullet doesn't occupy an index, so I can't change it using position.
This is what I want:
I think that unfortunately, goal cannot be directly achieved using Google Docs API, because, in the current stage, the text style of paragraph bullet cannot be managed.

How to use systemColor in the opposite way

I want to use systemColor in the opposite way in iOS13 UIColor, for example, systemGray6 is (242,242,247) in LightMode and (28,28,30) in DarkMode, but I want to use (242,242,247) in DarkMode and (28,28,30) in LightMode. What should I do? Apple says:
Don't hard-code system color values in your app. The color values
provided below are intended for reference during your app design
process. The actual color values may fluctuate from release to
release, based on a variety of environmental variables. Always use the
API to apply system colors; for developer guidance, see UIColor.
so how can I use systemColor in the opposite way and avoid hard-code system color values?
Simple Answer is create new colour set
First go to your project Assets .Add new colour set.
Then change it's appearance to Any,Dark,Light. set colours what you want in light or dark.
Now you use this colour in anywhere as color
something.color = UIColor(named:"myColor")

How to modify the focus-box color in TVirtualStringTree?

I need to modify the focus-box's border color of TVirtualStringTree,
just like this pic:
You can't control the color of the dotted focus rectangle. That's determined automatically by inverting the color of whatever it's drawn on. The OS provides — and the tree control uses — an API for that. (You could edit the source code and replace calls to DrawFocusRect with your own function, if you want.)
If you're talking about the color of the whole node, then first check to make sure the toUseBlendedSelection paint option is set the way you want it. It defaults off, but since it makes the selection rectangle look cool when dragging a box around items, you might have turned it on without realizing what it does to ordinary selected nodes, too.
If that's not it, then adjust one of the values in the tree control's Colors property, probably either FocusedSelectionColor or UnfocusedSelectionColor. But please don't make such a change lightly; the user has chosen the selection color through the OS options, so you probably shouldn't change it. If you do use a different color, make sure the text is still readable against whatever new color you select.
You can set treeview's option toHideFocusRectangle to true and paint your focus rectangle by yourself in one of several paint events (basically it is enough to use OnBeforeCellPaint).

Latex color box inline with text

I'm trying to put together a LaTeX color box. The xcolor package \fcolorbox seem to be what I want, but I can't get the rendering quite correct. When I use
\fcolorbox{black}{red}{}
it renders a small box sunken to the bottom of the text line. The best I've managed to do is to fake it with a similar text color:
\fcolorbox{black}{red}{\textcolor{red}{--}}
However, I'm worried that this won't render correctly in all situations with defined colors. Is there a way I can declare an empty text box with full in-line text height? Is there another solution?
I'm basically looking for the code that produces the color boxes all through the document at ftp://ftp.dante.de/pub/tex/macros/latex/contrib/xcolor/xcolor.pdf. The boxes I'm referring to are used throughout, but the first instance is on page 4. Thanks.
The xcolor.dtx file in the same directory as the pdf contains the source for the package and the source for the documentation. The relevant bits from the source for the documentation:
\def\testclr#1#{\#testclr{#1}}
\def\#testclr#1#2{{\fboxsep\z#\fbox{\colorbox#1{#2}{\phantom{XX}}}}}
...
(Answer: 40\% \testclr{green} $+$ 60\% \testclr{yellow} $=$ \testclr{green!40!yellow}, e.g., |\color{green!40!yellow}|)
Basically, use \phantom{} on the contents of your color box, and make sure that at least one of the phantom characters is full-height.
Also, https://tex.stackexchange.com/

Latex font color

I'm trying to typeset a document I'm working on.
Currently I'm trying to format a piece of text such that the text consists of two colors: a fill color and a line color. In this way the header should pop out more.
I found \psset with options such as linecolor and fillcolor, but I can't get it to work. Can someone provide an example of how I could do this?
Just providing a color using the color-package is no problem, but also not what I want because using this package I can only provide a single color for a piece of text.
Maybe this is what you're looking for: Contour package. Here's the doc containing examples.

Resources