IOS figure out shade of in grey keyboard buttons - ios

IOS default keyboard has the following buttons:
I am trying to make my own custom keyboard and I need to figure out the shade of grey/style (if they use something special to achieve that grey look) of these buttons.
I thought the RGB value was: (170,170,170)
but the UIColor UIColor.init(red: 2/3, green: 2/3, blue: 2/3, alpha: 1)
lends me a darker color that looks like this:
Am I possibly missing a transparency value and if so how can I figure it out?

You can use a color picker to figure it out.
It's (173, 180, 190).

Related

XCode 12.2 color literal from assets

Before if we drag assets colorliteral we can see the color with rgb but now if we drag color from assets it shows syntax like "color("filename"), how can i get old xcode like result in xcode 12.2 https://imgur.com/u2nloNW
It's not ideal but you can use UIColor(named: "CaseTypePrivate")
I can't seem to find any way to get the #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1) that we used to get when you drag-and-dropped from the assets menu.
One bonus at least of the first answer is that it will reflect any changes you make to your color assets; whereas the colorLiteral approach effectively hard-codes the color value.

iOS-Charts Library: BarChart background color fill

I am using a Charts library by Daniel Gindi.
I need to make a diagram like in this screenshot. Set a different background color. Could you do that? I looked at the library and found no way to do this.
Thanks.
There is a nice tutorial on AppCoda for iOS charts by Daniel Gindi.
"If you want a different color for each data entry, then you have to provide as many colors as the total number of data entries you have".
In order to change the color of the bar chart, you'll need to change the color of the dataset you're representing. Like so:
chartDataSet.colors = [UIColor(red: 230/255, green: 126/255, blue: 34/255, alpha: 1)]
If you mean to change the chart's background color, you need to put this in your code:
chart.backgroundColor = .white
Look, I specifically added the same arrays of data, and I added them to one bar chart. What I mean is that the same values alternate. They aren't represented one after another. So, it means that if you had a different background color for each bar, this wouldn't probably look nice imho.
I hope someone else will try to reproduce your question so that we have more opinions here :)
Use following configuration to barchar
barChart.drawBarShadowEnabled = true
Then use
chartDataSet.barShadowColor = .systemGray5
It works.

iOS 11 System gray color

I have a UIView directly below my default Navigation Bar and I am trying to make it appear that the region is one. To do this I am trying to match the color of my custom view to the color of the navigation bar. However, it doesn't seem to be any of the UIColors such as gray or lightGray. I would assume that if it is a custom color then I would be able to pull the color from the navigation bar, but I cannot seem to find the value.
you can use digital color picker app available in mac os,
Then whichever component's color you want just hover mouse pointer there and you will get the RGB Values in digital color meter and that RGB values you can use in setting the background of your view,
in this way,
UIColor.init(red: 49.0/255.0, green: 49.0/255.0, blue: 49.0/255.0, alpha: 1.0)

Xcode: Launch screen changes color without premission

After adding launch screen, I discovered the color of it is slightly different than what I specify, I chose R:31,G:174,B:240,A:1, but I noticed it is slightly a different color on the device (I took a screenshot and used a color picker to determine what color it is exactly), this drives me crazy, what can I do?
try setting the numbers over 255.
so:
UIColor(red: 31/255, green: 174/255, blue: 240/255, alpha: 1.0)
RGB is based of 255 and need a floatNumber.

Improve UILabel text visibility in Swift

I am showing the text on an UIImage in UITableViewCell, but UILabel text is dull. How to improve label text brightness? I have added Label on Image. I am also using Shadow image in label to make the text more visible, but the text is more dull in iPhone 6 Simulator.
How to manage it? And any other way to achieve this
And image or a description of what kind of "improvements" you are looking for would help to help you out better.
But the 2 most important things are probably font and color.
if you want to change the textColor. Use
myUILabel.textcolor = UIColor(red: 16/255.0, green: 177/255.0, blue: 216/255.0, alpha: 1)
Obviously changing the RGB values to something that looks good in your app.
to change the font and fontsize use something like this:
myUILabel.font = UIFont(name: "BPreplay", size: 20)
Also it's always better to test on an actual device. Gives you a much better view on how it feels on the phone.

Resources