Multicolor cursor in X - x11

X has the method XCreatePixmapCursor to create a cursor from a pixmap with a color depth of 1. The foreground and background colors can be other than black and white, but there are only two colors.
Is there a way to create a multicolored cursor in X?

You probably need to use the X Cursor Extensions. See the XCURSOR(3) manpage and the X11/Xcursor/Xcursor.h header file.

Related

Can I add a border to node labels?

I am using the STRING app in Cytoscape and find most node labels difficult to read. I want to have white text with a black border/ stroke so that it will stand out against the white background and the color nodes, but I can't figure out how to do this. Is there a way to add labels with white text and a black border? 'STRING style labels' are black with white borders, but are too small and seem to not be customizable.
The STRING style labels actually are customizable, but they use the enhancedGraphics plugin, so the information is stored in a column -- stringdb::enhancedLabel Passthrough. If you look in that column, you'll see how the defaults are set, but you can certainly change those defaults, for example, by changing the "labelsize" from 12 to 16. You can similarly change the font color, outline color, etc.
-- scooter

How to change tmux border size

I'm using
set -g window-style 'bg=default'
set -g window-active-style 'bg=#262626'
to highlight active pane in tmux and just same foreground for active/inactive borders
set -g pane-border-fg '#4d5057'
set -g pane-active-border-fg '#4d5057'
and I got this result, so, as you can see there is a big sized border, which has terminal default background and it looks awful, so im trying to find way to reduce border size in tmux to 1px or something like this.
Actually it looks like a padding but it's not, if we'll try to set border bg to red, for example, we'll get this result.
As additional information, I'm using Mac OS and iTerm2 as terminal, but same problem presented even in default terminal for me.
So, the question is: how to reduce border size to 1px or make border bg transparent (not default, which equals terminal bg)?
Thank you.
The borders are drawn by regular box-drawing characters in your terminal, so there is no way to make a border only 1px wide. The border will always be 1 character wide and 1 character tall, since it is drawn with characters.
A terminal application like iTerm may have the ability to draw at a pixel-perfect level and create multiple terminal windows to draw different panes, but this is because it has access to your OS or window system's low-level drawing commands. But tmux runs inside a terminal, and it only has one terminal window to work with. This is why it's limited to using normal terminal characters to draw borders.

How to add an image with transparency to a TDbgrid column in delphi?

I am trying to add an image to a column on a TDbgrid that takes transparency into account. When drawing the image from a TImageList on the canvas in the DBGridDrawColumnCell procedure, I need the background of the image (the same color as the pixel in the lower left corner) to take on transparency. I want this transparency area to show the highlight color or non-highlight color, especially when themes are used, such as Aero. I have been able to accomplish this in older versions of Windows with color values of clHighlight or clWindow as the background color. But with Aero themes, it always paints a box behind the non-transparent part of the image instead of the gradient blue highlight color that Aero uses. How can I accomplish this?
I believe I am supposed to use alpha channel but I'm not sure how to do this from a TImageList to a canvas. I believe the cell is painted completely with the actual highlight color before I start drawing on the canvas in the cell. I just want to draw the non-transparency part of the image and leave the background.
I was able to finally determine how to display images on a dbgrid with transparency even if themes, such as Aero is used.
I used a regular TImageList and loaded the images that I needed to display on the dbgrid. In my case there were two and they were in icon (ico) format. Instead of transferring the image to a bitmap and then drawing it to the dbgrid canvas as most old code recommends, I simply used the following simple code in the DBGridDrawColumnCell procedure:
if DataCol=0 then
begin
if (MApptsConflict.Value='<none>') then
ImageIndex := 0
else
ImageIndex := 1;
ImageList.Draw(TDBGrid(Sender).Canvas,Rect.Left+2,Rect.Top+2,ImageIndex,True);
end;
This will draw directly to the dbgrid canvas from the TImageList which will give the desired transparency.
UPDATE: I tried it with bmp's loaded in the Timagelist and it worked too.

Wrong color in Interface Builder's color picker

I have an UIImageView with a brown image that will not always reach the top part. The UIImage view is inside a white UIView.
So, because the top part of the image is a linear brown color, I said I will make the UIView underneath it the same brown color, and the user will not see where the image ends. So far, so good.
My problem is, when I pick the color in the top part of the image, the color picker picks a more darker color than actually is there :(
Before I click the color picker:
After I click the color picker:
How comes ?
Just wanted to elaborate upon the accepted answer with some screenshots.
If you want to match RGB values between Photoshop and Xcode exactly (without conversion between colorspaces) then you need to save your images in generic RGB and enter any dropper values using the generic RGB colorspace.
When you choose "Save for Web & Devices" from Photoshop, uncheck the "Convert to sRGB" box.
In Xcode, click the colorspace popup in the color picker and choose "Generic RGB", then enter the red, green and blue values from Photoshop, NOT THE HEX VALUE as this reverts back to the sRGB colorspace for some reason (be careful not to tab to the hex field either, as that also changes the colorspace to sRGB).
More info here, including how to match screenshots.
I've managed to find out a solution/explanation (tho I'm still confused) in this answer: https://stackoverflow.com/a/9203647/460750
Basically, what I did to solve my issues, was to choose from the RGB "types" select (that little square under the color picker) the Apple RGB option, and enter the R, G and B values manually, instead of using the picker.
Odd...
Its because the component numbers don’t spec a color. We also need to know the color space which xCode uses. Colorspace which encodes or decodes is available in the drop down left to the RGB slider.
By default xCode chooses the "Generic RGB" and that is what UIColor uses spec color from RGB. If we use magnifying glass, it will change to "Device RGB” space and that is based on your current screen.
So “sRGB" or "Adobe RGB" would be the better or close to what you want if you are using the magnifying glass to pick a color.
I think Generic RGB also works.
the trick is you need to enter number of R G B manually
after change the RGB mode in dropdown list
Odd... (too)
UPDATE 10.10.4
I had this issue as well, I reported it to Apple, and it seems to have been solved on 10.10.4 (it was related to the color picker itself, not to Xcode/IB)
Can someone else confirm it?
This is an old question, but it was important for me to add some info.
The only method that has been working for me accurately over the years was to not use PS's Color Picker, but use macOS' built-in "Digital Color Meter".
It's bundled with every installation of macOS and the RGB values emitted from there with "Generic RGB" always reproduce the correct color in Xcode Storyboards.

Change white png image to specific colour

I have a white png image, which is a part of a n icon.
I would like to change it's colour to get a coloured icon.
I know it is possible with hue/saturation setting, but don't know how to achieve a specific colour output.
I am using Axialis Icon Workshop (I have Photoshop CS5 also). The colourize option along with Hue, Saturation and Brightness adjustments will assist getting any colour output. But I specifically want colour #3366CC.
Is there a solution to convert my white png image to #3366CC coloured image?
This can be easily achieved if you go to the layers panel in Photoshop and select your icon layer. If the icon has a transparent background then select the fx button from the bottom of the layers panel and select color overlay or go to the menu at the top of the Photoshop screen and select Layer > Layer Style > Color Overlay. From the options box select the color box and put in 3366cc instead of the ffffff you have.
This should give you a coloured icon as desired. If this doesn't work let me know and I'll try to help.
You can go to layer style and choose color overlay, but that wont give you the color as you exactly want it, you can go a step further and hold the control key and click on the shape or the image you want to change the color, the shape will be selected, make a new layer on top of the shape or image that you want to change the color then fill in the color with the color that you choose in the layer property and set the mode to overlay, reduce the opacity to 50%. done

Resources