Way to get a color while transitioning - transition

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!

Related

Background changes color when hovering

So I have a grid in Zkoss with a certain amount of columns. One the first row I place two labels which fill the first two columns (as expected).
I've written their style so that they don't have change color when you hover the mouse over them however one of the columns label is much bigger than the other and when I hover the mouse over the smaller label the area around which isn't filled by the text goes to white.
ZKFiddle example
I'm going insane around this as I'm simply unable of making that area have the same background as the label.
Like I already said in your duplicated question.
CSS is responsible and you just need to search with developer tools.
This update to your fiddle tooks me 2 min.
The changed thing :
.z-row:hover > .z-row-inner, .z-row:hover > .z-cell {background:red; !important}

How to lighten up colors of syntax highlighting?

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.

MATLAB GUI tab ordering

In my current project I have a bunch of edit text boxes in my gui. When I/m in the first text blank and hit the tab key it skips to the third text box, when I hit tab again it goes to the second box. Every time I hit tab it jumps around in this weird order. I found out that the order is dependent on the order of the callback function for each text box. Without going in an copy pasting and changing around the code that gets generated by guide is there a better way to order my text boxes.
So for example when I'm in the box red x and hit tab it takes me to the box red z, than red y than green x then green z. I want to be able to click red x and then using just tab step through and fill out the other blocks. Is it at all possible to re-order?
GUIDE-generated GUI
When using GUIDE, you can simply use the "Tab Order Editor". Get to it using the following menu item:
For this simple GUI, with a single button and two text boxes, you would see the following dialog box:
Then set the tab order by moving UI objects up/down.
Programmatic GUI
To set the tab order programatically, you can use uistack to reorder the handles.
For example, to move a uicontrol "up" one in the order:
uistack(hui,'up',1)
To see the order of the handles to all controls in figure hf:
ch = get(hf,'Children')

Android custom input component with graphical representation?

I am looking all over the net to find out a code to make a custom input component that I need but didn't stumble upon anything similar. Here's how I'd like it to work:
the purpose is to input the quantity (a number)
the quantity is to be changed with two buttons (+ & -)
there should be a button to accept the input
Here's the tricky part - the graphical representation of the input:
I'd like to have two pictures representing the currently selected quantity in the following way:
q = 0:
Both pictures are dimmed
q = 1:
The upper-left quarter of the first picture is bright (normal) and the rest is dimmed
q = 2:
The upper half of the first picture is bright (normal) and the rest is dimmed
q = 3:
The upper half + lower-left quarter of the first picture is bright (normal) and the rest is dimmed
q = 4:
The first picture is bright and the second one is dimmed
q = 5:
The first picture is bright and the upper-left quarter of the second picture is bright
.
.
.
q = 8:
Both pictures are bright.
I hope I've explained that in an understandable way.
The question is:
Do I have to make 5 instances of each picture (dimmed, bright upper-left quarter, bright upper half, bright upper half + lower-left quarter, bright) or is it possible to have only one instance of each picture (bright) and to dim the portions (as necessary) with the code?
Of course, I'd appreciate a link to anything that would be of any help or chunk of the code.
I think you should be able to handle all of your conditions with just 2 images. But use a combination linearlayout,framelayout and imageviews. Some thing like this to represent one image.
FrameLayout
Imageview
LinearLayout (Divided to 4 cells using the weight property)
You can change the alpha value of the bg color of the linear layouts to get the dimmed effect.
This can also be done using different slices of the images and changing the alpha value of the imageview. You will need to find what suits you more. It wont be easy to find any code samples as this is not a common UI found in apps.

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.