Change UIView's background color like this *FFFFFF* - interface-builder

On Facebook iOS SDK Docs It reads:
Add the personal information to the SCViewController that displays when the user logs in. Make these changes in SCViewController.xib:
View: In the File Inspector settings, turn off ''Use Autolayout''.
View: Change the main view's background color to FFFFFF.
Question is, In IB, from where can change color of view like this (specifying value). All I know is changing color by using its default picker.
Sorry for the noob Question.

Whoever wrote this documentation at Facebook wasn't looking closely at the Xcode color picker (and you should file a bug and/or notify them of this fact).
First, you need to convert the hex web color into RGB values, which you can do using some utility or site. Here's one: Color Converter at Yellowpipe
And once you have your RGB values, you can then enter these into the Interface Builder portion of your main view, which looks like this (+1 to Tyler for his answer):
(source: bynomial.com)

Related

Set secondary color of all views

image of an Editor
Like shown in the image above my secondary color for all my views is pink.
But I want it to be a different one.
Where can I set the Color globally?
For the Entries that pink color is the color accent of the application
Which can be modified of course. example
But if you want a little more customization for this view and maybe others. You will have to use custom renderers. Here is another question about that

Custom Button in Swift and MacOS

In MacOS there is a simple App called Calculator, that I would like to recreate using Swift for learning purposes. A button like the plus button on the calculator has two images associated with it, one when the button is up and one when the button is down, as seen on the images below.
As you can see, when the + button is pressed down, its image changes to a darker orange color and the text gets a dark grey color. My question is: How to implement this button behavior?
Is it possible to do it with NSButton (and if so how)? or is it easier to implement it using CALayer? Or maybe there is some other way that I have not thought of?
You should be able to use a single image and configure it in code or in your asset catalogue to be a "template image". That means the shape is taken into consideration, much like a stamp, and the stamped-out area is filled with color dynamically. That means you don't have to provide a white and dark gray/black variant. One variant will suffice, usually black to see the lines well, and the rest can be configured through.
See the SO question "How to NOT highlight the NSButton's template image when clicked?" for details about the setup: How to NOT highlight the NSButton's template image when clicked?

Toggle NSToolbarItem between Black and Blue

I'd like to make an NSToolbarItem with a custom image which toggles between Black and Blue, like the icons at the top right of Xcode 5's main window.
Peter Hosey suggested in this answer that it was as simple as setting the image to be a template, but I haven't found that to be the case. I set it to a template image, and that causes it properly render the dark gray gradient, but it doesn't render in blue when toggled.
I uploaded a very simple example of what I've done, here. If someone could tell me how to change it to light up the NSToolbarItem in blue, as Xcode does, then I'd very much appreciate it.
You mostly have everything you need in place, with the exception of providing an NSButton object using the style NSTexturedRoundedBezelStyle, with which you’ve associated your image.
↳ modified example project here
⌘ OS X Human Interface Guidelines | Window-Frame Controls

Powerpoint - want to define a color palette that is NOT a color scheme

I import Spotfire graphics into Powerpoint quite frequently. Spotfire has its own specific color palette, which aren't the standard colors used in powerpoint, at least I don't think so.
I often must create my own legend or for other reasons match the spotfire color palette, and I do this by entering the RGB codes for the spotfire colors. I would like to do this one time and have the spotfire color palette always available in powerpoint without having to re-type.
I do not think I want to use a color theme, because I want my colors to stay consistent if I end up using different templates (themes). That is, I don't want to call spotfire default blue "Accent 1", because if I change background templates (themes) I think it will overwrite Accent 1 with the new template's Accent 1.
So I want a color palette that is always available to me regardless of what theme I choose.
Any thoughts?
You're dismissing themes for all the right reasons. They wouldn't work for what you're after. You'd pretty much need to buy or write an add-in to do what you want.
For example, it might install n buttons on the toolbar/ribbon, where n = the number of colors you need on your palette. When the button is clicked it sets the fill, for example, of the currently selected shape/shapes to the appropriate color.
You could have different sets of buttons for fill, outline etc, or have the code figure out whether the user has pressed, eg the CTRL key. Click = set the fill, CTRL+Click = set the outline.
Because I was curious I decided to attempt to create a simple Add-In that will allow you to select a chart, series in the chart, and then apply colors.
You can download from Google Docs (revised link)
https://docs.google.com/file/d/0B1v0s8ldwHRYMFFPZ29FNmI0TkE/edit?usp=sharing
The file is saved as a PPTM to expose the code modules. Save As a PPAM and load the Add-in; it will be available from the Add-Ins command bar. I have tested briefly and seems to be working.
Here's the nuts & bolts of it:
First declared several custom colors as Public Const variables. These can be modified using the long value (converted from RGB) to suit whatever you need.
The macro requires that the selection be a Shape, and further that the Shape .HasChart = True. There is some logic to trap these conditions.
A user form has a ComboBox that populates with a list of Series from the selected chart, and 8 CommandButtons colored for each of the defined colors, will send that color to the chosen series.
You could add additional CommandButtons and colors as needed, or tweak the existing code to suit your specific needs.
Although the slide templates have a default color theme attached to them, you can switch slide templates and still use any XML color scheme at your disposal.

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.

Resources