nscolor Questions
5
Solved
In my web view, I'm using CSS variables to change various colors at runtime depending on whether macOS 10.14's dark mode is enabled. That much is working fine. The tricky part is updating the color...
Velate asked 25/9, 2018 at 18:44
7
Solved
I want to use my color assets from the assets catalog using color literals.
In UIKit, we can directly use color literal is there any way to use color literals in SwiftUI
I have searched from Color ...
7
Solved
I'm trying to convert an NSColor to RGB, but it seems to give an entirely incorrect result:
NSColor *testColor = [NSColor colorWithCalibratedWhite:0.65 alpha:1.0];
const CGFloat* components = CGC...
Krever asked 28/3, 2013 at 13:18
2
Solved
I have an NSImage. I would like to read the NSColor for a pixel at some x and y. Xcode seems to thing that there is a colorAtX:y: method on NSImage, but this causes a crash saying that there is no ...
Mungovan asked 15/3, 2012 at 18:36
2
Solved
I have found that time of the string colouring depends on how many different NSColors are used. In code below if I use only one colour for the three cases then the text colouring process is 3 times...
Irreligious asked 31/1, 2017 at 16:47
2
Solved
There are several convenience class methods for creating a NSColor. However, I can't seem to identify when to use the different class methods below:
colorWithSRGBRed:green:blue:alpha: vs colorWith...
Vowel asked 24/9, 2012 at 15:45
3
Solved
In my application, i will get RGB Values as a unsigned character so it will not be more then 255,
I am using NSColor API to create the color and will make use of it to draw the font and background...
Recapitulation asked 23/2, 2011 at 12:0
3
Solved
As discussed elsewhere, NSTabView does not have a setBackgroundColor method and subclassing NSTabView and using an drawRect to control it does no longer work - as it does not paint the top 10%, the...
3
Solved
I'm trying to make a NSObject subclass that will have a lot of methods that return colors, so I wanna return UIColor if I'm building for iOS or NSColor if I'm building for OS X.
This is kind of a p...
Chasechaser asked 14/2, 2014 at 19:3
1
Solved
I'm making an OS X app which creates a color scheme from the main colors of an image.
As a first step, I'm using NSCountedSet and colorAtX to get all the colors from an image and count their occur...
Sjambok asked 24/6, 2015 at 12:36
2
I'm working on an app that has a custom NSView on a NSStatusBar which performs all of the drawing when the user clicks it. But here's the problem, the color I'm currently drawing as the view's back...
Meatus asked 4/4, 2015 at 4:4
2
Solved
I am creating a custom view for an NSMenuItem. In order to draw the background when selected, I adapted a couple of lines from the CustomMenus sample. The CustomMenus sample has:
[[NSColor altern...
Recant asked 21/9, 2014 at 23:18
3
Solved
What's the difference between UIColor and NSColor, and when would one use each? I came across NSColor while trying to figure out UIColor uses for attributed strings in iOS. I understand the use of ...
Tasso asked 29/5, 2014 at 0:38
2
Solved
What would be the best (as in: most concise) way for setting just the alpha component of a predefined color?
Say I'd like to use something like + (NSColor *)brownColor but with 50% opacity -
I cou...
Virg asked 6/2, 2014 at 19:42
3
Solved
I'm looking for a way to invert arbitrary NSColor values at runtime, and there doesn't appear to be any built-in method to do so.
I will be using a category to extend NSColor as follows:
NSColor * ...
2
Solved
Mountain Lion introduced new APIs, some of which we had implemented as categories in our project.
For examples, we have a category NSColor+CGColorAdditions that implemented CGColor and colorWithCG...
Courtier asked 14/8, 2012 at 10:16
1
© 2022 - 2024 — McMap. All rights reserved.