Hi Guys,
I'm having trouble setting Colors to an 'NSTextField' instance.
Here are some screenshots
I set the RGB values using 'colorWithCalibratedRed' API of NSColor to the 'NSTextField' instance. But the values dont seem to change
Green label here

Changing the Red value makes a change to yellow

But changing the Red value does not change the output - it is yellow always

Adding a value to the Blue textbox, removes the color!

This is the code - where 'self.color' is an instance of NSTextField
NSTextField *color;
What can be the problem and what am i missing?
Thanks in advance!
I'm having trouble setting Colors to an 'NSTextField' instance.
Here are some screenshots
I set the RGB values using 'colorWithCalibratedRed' API of NSColor to the 'NSTextField' instance. But the values dont seem to change
Green label here

Changing the Red value makes a change to yellow

But changing the Red value does not change the output - it is yellow always

Adding a value to the Blue textbox, removes the color!

This is the code - where 'self.color' is an instance of NSTextField
NSTextField *color;
Code:
- (IBAction)onAddCharacter:(id)sender
{
float RedValue = [self.red.stringValue floatValue];
float GreenValue = [self.green.stringValue floatValue];
float BlueVal = [self.blue.stringValue floatValue];
float alphaVal = [self.alpha.stringValue floatValue];
NSColor *myTodayColor = [NSColor colorWithCalibratedRed:RedValue green:GreenValue blue:BlueVal alpha:alphaVal];
[self.color setFont:[NSFont fontWithName:@"Arial" size:48]];
self.color.refusesFirstResponder = YES;
[self.color setTextColor:myTodayColor];
[self.color setStringValue:@"Some Text"];
//[textField setBackgroundColor:[NSColor blackColor]];
[self.color setDrawsBackground:YES];
[self.color setBordered:NO];
}
What can be the problem and what am i missing?
Thanks in advance!