Change the label color in Google Static Maps - google-maps-static-api

I have custom coloured pins, which are all fairly dark in colour. The label defaults to black text, is there any way to make it white text so that it shows up on the dark pins?

In the current version of the Google static maps API (V2) it is not possible. Black is the only colour available.
Update: A workaround, albeit very hacky, is to upload the coloured text you want as images and use them as custom icons. See https://developers.google.com/maps/documentation/staticmaps/#CustomIcons

Related

the best way to handle dark mode logos in html emails

am designing a html email template that supports dark mode for all email clients but am facing a problem with the logo.
The logo is a black .png image and the default/light background is white, so in dark mode it becomes black over black. Adding an outline to the logo is not an option, using 2 images with classes and controlling which one to display using media queries won't work for Gmail ios and some outlook versions, so am left with three choices but am not sure wither they are applicable and supported by all famous clients:
forcing the white background by using a gradient as the background-color value instead of a hex value
using this method that I found online for webpages:
<picture>
<source srcset="dark-mode.png" media="(prefers-color-scheme: dark)">
<img src="light-image.png">
</picture>
using an SVG instead of the image so the fill color will change.
So, are any of them is applicable and supported?
Also, more suggestions/ideas/options are appreciated.
Support for SVG is quite limited so unfortunately that's not an option: https://www.caniemail.com/features/image-svg/
#media prefers-color-scheme: dark is not supported on Gmail/some Outlooks, so that's not going to work. https://www.caniemail.com/features/css-at-media-prefers-color-scheme/
Using a gradient to force unchanging background is not ideal (we should be supporting customer's preferences), and also not 100% cross-compatible. (background-image: linear-gradient(#ffffff,#ffffff);)
If a 1px white stroke is no good for you, you could try a soft glow like Litmus do.
Alternatively, sometimes we just end up putting a single-colour background in the image itself (i.e. getting rid of the transparency), perhaps with rounded corners (a tiny bit of transparency on the corners). Works best for icons, but might be your only option.

Dark Mode - Button and font colors

Currently I have a button that changes the background color of my app (my users complained that it melted into other windows when grey, but others wanted that color scheme). I have 3 color options: grey with black text, light blue with blue text, and purple with white text.
Problem 1:
Dark mode is messing with my color scheme - can I set something up to adjust based on if they have dark mode on? Otherwise, I'm going to have to end up with grey text with a grey background in order for it to be ok when it switches back to grey.
Problem 2:
Button text - this wasn't so bad when using light mode because the buttons didn't change color, but on dark mode, this gets hard to read the button. White text on a light blue background hurts my eyes
I'm unable to attach images due to my level
I'm using Xcode 11.5, swift 5, and I'm coding for a Mac Application
Sounds like you are using the system color for the text / background color. And in dark mode, IOS will automatically change the system color for different mode. For reference:
https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/#dynamic-system-colors
Indeed for both problem 1&2, if you want to use custom color (not the system one) for each mode, you can put your color sets into an asset file (and I would suggest adding a new one, rather than adding all color together with your image). For each set of color, set them to the desired appearance (any, light, dark), then set the color by code.
Apple give a detail documentation about that:
https://developer.apple.com/documentation/xcode/supporting_dark_mode_in_your_interface

Change background color of the tile programatically?

I understand the background is actually an image (WideLogo.png/SmallLogo.png) and specified in the app manifest file. But is it possible to swap these with a new set of images programatically? Based on the information displayed on the tile, I want to change the background color of the tile.
You cannot edit the app manifest to change the default color. However, you can render an image with the appropriate background color and content then set it as tile.
For more details on how to achieve that, read: Windows 8 Metro App - Render PNGs
I don't think you can change the background color of the tile programmatically. That's set in the manifest for the default tile, so that you can overlay a transparent background image for a predictable default look for your tile.
But you can send tile notifications from your app while running, and these can include images and text.
Here's a link to the MSDN docs on tiles and notifications:
http://msdn.microsoft.com/en-us/library/windows/apps/hh779724.aspx
and to the catalog of tile templates you can use:
http://msdn.microsoft.com/en-us/library/windows/apps/hh761491.aspx
One way you could implement this is to programmatically create a tile image with the background color and text you want, and then send that as a tile notification.

How to know the background color of Pdf

Sometimes pdf might have a transparent background. And In my application I have given a option to choose background. So, in case of pdf with transparent background and background color black all things becomes black black so, any way to check or any key inside dictionary of pdf page that can help me? Any help will appreciated.
The easiest solution for you would be to remove black color from available background colors.
Generally, all pdf pages have transparent background and the white background color is set by the viewer application. It is possible to set a background color for each page. You can read all about it in Page Group under Transparency section of the PDF Reference.
It is also possible to show a background color for a page by setting 'BoxColorInfo' dictionary in the page dictionary with appropriate values.
But I am not sure what you can achieve by knowing what color a page background is, since black background is going to be a problem for PDFs with transparent pages anyways.
EDIT: Following is the paragraph from PDFReference i was trying to point you to:
Ordinarily, the page is imposed directly on an output medium, such as
paper or a display screen. The page group is treated as an isolated
group, whose results are then composited with a backdrop color
appropriate for the medium. The backdrop is nominally white, although
varying according to the actual properties of the medium. However,
some applications may choose to provide a different backdrop, such as
a checkerboard or grid to aid in visualizing the effects of
transparency in the artwork.
It says that most PDFs would have a transparent and it is your application which shows the background color. Hope this helps.

Convert an image to an iPhone toolbar icon

I have a grayscale icon that I'm editing with Photoshop with a transparent background, but I can't, for the life of me, figure out how to convert the icon to one that can be used as an iPhone toolbar icon. If I simply save the image as a PNG, it doesn't show up as anti-aliased on the iPhone because every pixel with color is being rendered as black, instead of a shade of gray.
According to the Apple docs and other sources, there needs to be an alpha channel on the image to specify varying levels of transparency for each pixel. However, I have no idea what that means. I've read these posts and docs from Adobe and I still can't figure out how to properly convert a grayscale image into one that can be used as an iPhone toolbar icon. The blog post is hard to comprehend and poorly written, and the Adobe docs don't really help.
http://cahit.hayalet.net/blog/514/converting-an-image-to-iphone-toolbar-icon/
http://livedocs.adobe.com/en_US/Photoshop/10.0/help.html?content=WS74B356C9-353F-4483-8632-7B1A102F2A2E.html
Can someone point me in the right direction or provide exact, step-by-step directions to doing this in Photoshop?
It's much more simple than having to muck with actual masks in Photoshop.
iPhone toolbar icons are about 30px by 30px, so make a new Photoshop file with those dimensions. Ensure the background is transparent (you can specify that when creating a new file).
Then, any pixels you draw on top of this transparency become what iOS uses for the icon. Doesn't matter what color it is in Photoshop for NSToolbar icons -- they're automatically used as masks by iOS.
Leave transparent the parts you want to show through. Save as 24-bit PNG, and chuck into XCode as usual.
For a few icons that serve as good starting examples, check out the ones I publish for free here: http://glyphish.com Just take one of the PNGs and open it in Photoshop and you'll see that it's drawn in an arbitrary color (#444444) with varying levels of opacity to create darker and lighter parts of the icon.
This is more of a photoshop question than coding but anyway, here's a suggestion.
Lunacore has a good tutorial on how to use masks.
What you want to do is:
Make sure you're background is transparent.
Create a new layer and
fill it with any solid color.
Create a mask on the solid color
layer, and fill your greyscale image into the mask. (Use your
greyscale image as the mask.)
Toolbar icons use your image as a mask. They only consider what transparancy the image has. Not what color or shade.