I know how to make NSStatusBarItem's image for both light and dark mode (by just setting the image as template, image.template = true). Also, to make the button have disable appearance, we can play with appearsDisabled property.
However, there is another interesting thing about NSStatusBarItem. I saw the NSStatusBarButton of Dropbox and Bluetooth have both inactive and active images on top of each other. You can try to pause Dropbox and you will see a pause image clearer than the Dropbox image. Also, when the Bluetooth is connected, you will see three-dots image on top of the Bluetooth image.
I have tried to put white and black colors for the image, even grayscale. But it turned out to be something different. I think it should be something to deal with 2 different images.
How can I have this kind of image on the status bar?
You can create this effect using different alpha values for pixels in the image. So for the example of dropbox in the paused state, the status bar item has an image where the pixels creating the paused icon are black and fully opaque, and the pixels creating the dropbox logo that appears gray are also black but with alpha 0.5
Related
I've been trying to create icons without transparent backgrounds, but I keep getting strange results. For example, when I make icons with white backgrounds, their bottom rows will wind up with yellow pixels.
Steps to reproduce:
Create a square PNG file with solid white.
Right-click on any application and select Get Info.
Click-and-drag the PNG file to the application's icon in the upper-left.
Notice the icon has a strip of yellow pixels on the bottom.
I was having trouble creating Finder icons to match the macOS aesthetic, so as a test, I tried making icons without transparency. But then I ended up with a new problem.
It sounds like what you're talking about is a quirk with the Apple Icon Image format. If you read the Wikipedia entry on ICNS files there is this known issue: "if the last value is a repeating byte (see Compression). Potentially, up to 130 pixels can lack the blue channel value." So, in RGB, if you remove B, you get yellow, which is likely what you're seeing.
I want to be able to layer images(PNG) with blank space over other images and have the images underneath still partly visible. right now my Image loading function will prints black space where it should have the background image.
As Noah mentioned, if your PNG images don't have an alpha channel, you can use LÖVE's blend modes.
https://love2d.org/wiki/BlendMode
Try displaying your image with "premultiplied", for instance.
love.graphics.setBlendMode("premultiplied")
love.graphics.draw(myImage)
love.graphics.setBlendMode("alpha")
"alpha" being the default blend mode.
I created an extension for Firefox and made a simple icon for it.
But when I tested it in the Addon manager the icon appeared blurry despite my source image was fine.
I started to experiment with different sizes and shapes of the icon.
Figured out that the icon container is 48x48 pixels and the default addon icon is 32x32.
But for any experiments the result was the same.
So I created a simple rectangle icon drawing it by pixels so it shouldn't blur anyway:
But the result blurred again:
There is some sub-pixels around the rectangle though the border should be crisp...
In pixels view:
Also I found the default extension icon (a puzzle piece) and in pixels it looks perfect but in the manager the borders are blurred a little though it's not obvious at first glance.
Are you sure this is not happening when you save the image? I don't know what app you are using, but many photo apps try to compress jpm images when you save them by default. Check this first.
Usually this does not happen with png images, so you could try using a png image instead as well.
It was silly enough... The broblem was the page scale not 100% on the Addons page. Pressed Ctrl+0 and all restored.
It happens sometimes on other web pages when I zoom in/out the view and images lose their sharpness.
Is there a way to change the background color of the xcassets view in Xcode 5 or Xcode 6?
I have white images that are lost on the white background.
When viewing an image without using xcassets, the image is set against a grey background.
However with xcassets the background is white and the images can't be seen.
I've tried using different different font and color schemes but they only seem to apply to the text editor.
A reasonable work around is to select the image asset, (eg click on the 1x or 2x version) and then press the spacebar.
This will show the asset in a popover with a light grey background.
If you are happy to add an Xcode plugin (it's available via Alcatraz) then
TOCAssetCatalogBackground solves this problem. https://github.com/toco/TOCAssetCatalogBackground
Are the images essentially silhouettes? If so, you could make them in another color (I like to use magenta, because then it’s immediately clear when something isn’t working). Then you can use iOS 7’s -[UIImage imageWithRenderingMode:] (not sure if there is a Mac equivalent) to have the image automatically pick up the tint color of its containing view. Then you would not be looking at white images on a white background.
I am trying to build a windows phone live tile. I want some text on the tile that is the accent colour. What this means is that I need to draw some text on the tile that is transparent. I don't seem to be able to write in the transparent colour.
I have a User Control which is 173 by 173 pixels which I save as a png file. I use this png as the image for the live tile. The transparent bits of the image come out in the current accent colour.
Any ideas how to write in the transparent colour in xaml?
This behaviour is to be expected. In your original question you are effectively saying "Write invisible text on top of the image", and that's what you're getting (imagine writing in invisible ink on a photograph). You effectively need to do one of two things.
1) Figure out which pixels are part of the text you're writing, and "remove" them from the image so the background colour shows through, or
2) Write text in the background colour ({StaticResource PhoneAccentBrush})
EDIT
You can probably achieve what you need using an Opacity Mask. Apologies for only providing that as a link as I haven't done this myself.