How to lighten up colors of syntax highlighting? - emacs

I need to make syntax colors lighter (for dark themes). Globaly or not.

Yes, in fact there is a dimmer switch that affects all faces. There are in fact several such dimmer switches: (1) to dim/brighten, (2) to heighten colors or make them more washed-out, (3) to move toward or away from a particular hue, or (4, 5, 6) to make them all more - or less - red, blue, or green.
All of these dimmer switches that act on all faces together are rolled into a single command -- well two commands: one for the face backgrounds (doremi-all-faces-bg+) and one for the face foregrounds (doremi-all-faces-fg+).
These are two of several Do Re Mi color incrementer commands. The others work on individual faces or on frame backgrounds and foregrounds. All of these commands work the same way. After invoking the command (e.g. M-x doremi-all-faces-bg+):
You are prompted for the color COMPONENT to increment/decrement (a character):
`r` - red
`g` - green
`b` - blue
`h` - hue (basic color)
`s` - saturation (purity)
`v` - value (brightness)
`R` - red, green, and blue, at the same time
`H` - hue, saturation, and value, at the same time
`R` and `H` increment all components of the respective color spaces,
according to the value of INCREMENT.
You can at any time change, to increment/decrement a different color
component (r, g, b, h, s, v, R, or H). For example, you can type `r`
and use the arrow keys or mouse wheel to change the red component,
then type `b` and use the arrows or wheel to change the blue
component, and so on, all in the same call.
For desaturating, that is, to render all colors more pale or washed-out, you just use s.
See Angry Fruit Salad for more information about this synchronized saturation dimming of all faces.
You can use the dimmer switch whenever you want, if you want more or less washed out colors. Or you can use it to find a good combination and then save the current face values in your custom-file (or your init file, if you do not have a custom-file, which you should have).
More likely, you will want to experiment by "dimming" and then follow that up with some customization of a few individual faces. For that, you can use the similar dimmer switches for individual faces (doremi-face-bg+ etc.). Incrementing qualities of all faces at once is a bit rough-and-ready. But for something like desaturating, it is very quick and does the job well.
Note that the face changes made using Do Re Mi commands are not saved automatically. User option doremi-customization-status controls how Customize views such changes.
By default, Customize sees them as if you had made them using the Customize UI. In this case, you can use command customize-unsaved to open Customize for them all, where you can save individual changes or all of the together.
If you set option doremi-customization-status to value outside then Customize sees the changes instead as having been made outside Customize. In this case, you can use command customize-rogue to open Customize for them all.
If you set the option to anything else then Customize ignores the changes altogether - you cannot use Customize to save them until you reapply them using Customize itself or a command such as set-face-foreground. This option setting can be useful if you just want to experiment and do not want Customize to see what you do.

Related

How can I make each Packed Bubble a different color?

I have a Packed Bubble dashboard. My Y axis is a list of names and my X axis is a decimal. I want each differing number to be a different color. Can I do this manually?
If you want to color each bubble with a separate color just use the field that each bubble represent in the color shelf. If I understood your data correctly, each bubble basically represents one campaign, so you should use that as the color.
You can manually assign color using Color>Edit Color and assigning the color of your choice.
See image 1.
If you want to color your bubbles based on your measure AVg(NPV/Marketing $) you can do as Alex Blakemore mentioned and use your measure as a stepped color or gradient.
You can use Color>Edit Color here too , in this case manually assigning color is a bit difficult. But if you play with number of steps, the gradient pre-select, etc, you can usually get very close to what ever your wanted it to look like.
Put your numeric field on the color shelf, and either edit the colors to use a stepped set of colors - or change the field to be discrete and choose individual colors to taste.

MATLAB R2014b switch back to old color scheme?

As announced, MATLAB R2014b adopts a new color scheme, which sort of replaces red with orange and blue to gray blue.
I would like to opt back for the old scheme. How may I do this?
P.S.:
If I am simply plotting dot, lines, and all that, I can just specify the color myself. However, this is not the case.
I am calling a sophisticated drawing function, which displays the heat map with the MATLAB color scheme. They used to be "blue for cold, and red for hot", and now they become "gray blue for cold, and yellow for hot". It is just counter-intuitive!
Therefore, to avoid modifying the function, I would rather switch the whole graphics system back to pre-R2014b scheme.
The old default colormap is still available - it's called jet.
If you want to set the colormap for individual axes or figures back to the old default, you can do that with colormap(figHandle, jet) or colormap(axesHandle, jet).
To change it for all your plots, try set(groot, 'DefaultFigureColormap', jet). You may need to set that each time you start MATLAB, so perhaps you might want to put the command into a startup.m file.
However I'm not sure I agree that the new colormap is less intuitive; in fact there is quite a bit of solid evidence that it is much worse in some very specific ways. That's why they changed it. Your choice though...

Is it possible to fill transparency with white in a texture in code?

I have some textures containing some transparency parts (a donut, for example, which would show a transparent center). What I want to do is fill the middle of the donut (or anything else) with a plain white, in code (I don't want to have a double of all my assets that need this tweak in one part of my game).
Is there a way to do this? Or do I really have to have 2 of each of my assets?
First it is possible to change a transparent texture to not-transparent, if it wasn't then graphic editors would be in trouble.
Solution 1 - Easy but takes repetitive editing by hand
The question you should be asking yourself is can you afford the transition at run time or would have two sets of textures be more efficient; from experience I find that the later tends to be more efficient.
Solution 2 - Extremely hard
You will need a shader that supports transparency and that it marks the sections that have to be shaded white. That is, it keeps track of which area will be later filled with white. It is implied that since your "donut" is already transparent on some parts then it already uses that texture that has an alpha, but you will have to write your own shader mask and be able to distinguish which is okay to fill white and which is not (fun problem here). What you need to do is find the condition in which that alpha no longer needs to be alpha and has to be white. Once the condition is met you can change the alpha of via the Color's alpha property. The only way I see you able to do this is if there is a pattern to the objects, so that you can apply some mathematical model to them and use that to find which area gets filled. If the objects are very different then the make two sets of textures starts to look more appealing.
Solution 3 - Medium with high re-use value
You could edit the textures to have two different colors, say pink and green. Green is the area that gets turned white and pink is always transparent. When green should not be white then it is transparent. You would have to edit your textures by hand as well.

Way to get a color while transitioning

I thought about the whole transition thing, and also saw while a text's color is being transitioned - it crosses through other tints of colors.
I had a lot of situations when I saw a beautiful color which I wanted, but it was a part of the transition process, and I eventually couldn't accomplish it.
For example, this code:
HTML:
<div id="transition">
ultra super califragilisticexpialidocious
</div>
CSS:
#transition {
color:black;
transition: 1s color;
}
#transition:hover {
color:#f00;
}
A demo: JsBin
You could see the transition shows a maroon color while text is transitioned, and my meaning is, how can I get this special tint of maroon?
Generally, my question is, how can I get a color while it is transitioned? There's a way to pick it?
Thanks in advance
Well, the things we think we like most are often those that are hard to get ;-)
But it's not so hard in this case. The question is whether picking the transitioning color is the best way to get what you want. Wouldn't it be simpler to change the color by hand until it looks best?
This is how to easily change a displayed font color with the Firebug plugin of Firefox:
Open the page with the transition and open the Firebug window.
Select the HTML tab, and then the Style tab of the side panel (if the side panel is closed, open it by clicking on the small arrow in the top right corner).
Click on the button with the mouse pointer in the top left corner of the Firebug window, then click on the div with the transition, thus selecting it.
You may want to disable the transition in the style, by clicking to the left of it.
You may want to display colors in RGB instead of hex (you can toggle back and forth when you want), by clicking on the dropdown button in the Style tab and selecting the mode you want.
You can click on the color value to edit it. Instead of rewriting it, you can click again on a single component (works in hex mode too), and then use the up and down arrow keys. It's almost like having a slider for each component. If you have the whole value selected, the arrow keys change all three components simultaneously.
Chrome is almost identical in operation. You open the Developer Tools with Ctrl-Shift-I, select an element with the magnifier button, and edit its style. You can toggle between hex colors and RGB colors by clicking on the gear-wheel within the Styles window. The difference with Firebug is that you can only modify the single RGB values with the up and down arrow keys when in RGB mode, in hex mode the arrow keys can only change the hex value as whole (i.e., starting from the B channel).
Knowing the numerical values of the endpoint colors of the transition, you can guess the numerical values of the "transition color" you want. The numerical value of each RGB (red, green, blue) component will be an intermediate value between its endpoints, more or less close to one of the two endpoint values.
The browser is free to interpolate by using the algorithm it prefers. The easiest algorithm moves colors along a straight line in the three-dimensional RGB space. Interpolated colors in this case (called linear interpolation in RGB space) are integer approximations of
R = R[0] * (1 - t) + R[1] * t
G = G[0] * (1 - t) + G[1] * t
B = B[0] * (1 - t) + B[1] * t
for t varying from 0 to 1. For t = 0.5 you get the color which is linearly (in RGB) halfway between the two endpoints. The parameter t may be any function of time (in the simplest case it is a linear function, which means that the color moves at constant speed in RGB space between the two endpoints).
As I said, the browser is free to interpolate in a more complicated way, in order to achieve a better visual result. If you really need to see what the browser does, you can slow it down to snail speed (e.g., by editing the transition-duration with Firebug), then grab the screen (e.g., by pressing the "Print Scrn" key), open your favorite image editor, paste the printed screen (often by pressing Ctrl-V), and finally select a fully colored pixel to get the RGB values of your long craved color.
BTW, your test case is particularly easy, because the endpoints are (0,0,0) and (255,0,0), so that the maroon color you are after is almost certainly nothing but a dark red of the kind (x,0,0). You only have one parameter to vary, you can even do it by trial and error with an editor!

IDE or plugin to add helpful graphics or illustrate code as-is?

I was staring at my code thinking how boring the text looks.
All I see is text, with no visualizable structure.
Visualizable structures would be awesome:
Background graphics such as 3D half-pipes on edge connecting the opening and closing brackets of loop scopes, nested in 3D to show how deep the loops are nested.
Wires with arrows along them showing where a goto statement points, with a code section highlight (or preview if out of viewport) of the target label.
Conditional blocks could be rendered to show the "true" code in a positive color and the "false" code in a negative color, and mousing over the background at the left edge could reveal a preview of the condition statement for that block (appended with "== true" or "== false" depending on the code context).
Icons for Types, that show up in front of variable names so you know what type they are.
Change the background of the method, displaying tiled locks or keys, depending on whether you type public or private in front of the method (a nice indicator of the default if you fail to specify either).
Is there anything out there that illustrates code like this?
I don't mean analytically generated graphics representing the code or algorthmic structure in some way. Rather, I mean something that actually illustrates the editable code in place.