-
Notifications
You must be signed in to change notification settings - Fork 805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to visualize colors #103
Comments
Nice. Can I interest you in trying a pull request 😄 |
Definitely interested. I’ll put it on my list for my job’s semi-weekly hack days. |
Let me know if you have any questions, happy to answer anything. |
@kastiglione would it be a faux pas to |
Specifically: result = frame.EvaluateExpression('(CFTypeID)CFGetTypeID({color}) == (CFTypeID)CGColorGetTypeID()'.format(color=color)) |
Nah. In fact I think it would be great to do, |
Not to give you scope creep, feel free to put it in your command only. Someone can look to make it more general later. |
I've seen it advised to always import UIKit on an exception breakpoint. I had put a UIKit import in my Current question: here's an error I'm getting in lldb:
From a python line like this: colorToUse = '[UIColor colorWithCGColor:(CGColorRef){}]'.format(color) Seen anything like this? |
Or, to simplify the question, what is the right way to call this in
|
Cast the color to |
Nope:
(assuming that's what you meant?) |
Yup, that is what I meant. Hmm. Maybe one of:
|
Oh, I'm curious why you're going from |
Just a simple test case to reproduce what I’m seeing in the script with a |
None of the suggestions worked, but worse, the actual case I'm trying to use also doesn't work. If I'm on a breakpoint and I have a local variable,
So I can't use it in my script because it doesn't even work in the real debugger, at least not with the incantations I'm using. |
It looks like this is maybe already done in chisel? Does this code work? https://github.com/facebook/chisel/blob/master/commands/FBAutoLayoutCommands.py#L44 lldb.debugger.HandleCommand('expr (void)[%s setBorderColor:(CGColorRef)[(id)[UIColor %sColor] CGColor]]' % (layer, color)) |
@kastiglione alright, I got a workaround thanks to @jvisenti: http://stackoverflow.com/a/31810890/255489 I believe it's related to the UIColor going out of scope, and @property(nonatomic,readonly) CGColorRef CGColor;
- (CGColorRef)CGColor NS_RETURNS_INNER_POINTER CF_RETURNS_NOT_RETAINED; PR should be in at some point soon-ish |
If I run
visualize someColor
, I get:Chisel should generate a square or circular image of the color, optionally with some RGB/hex info included in the image, and open the image in Preview.
The text was updated successfully, but these errors were encountered: