How to change the color of a button ?

I need an app like a Christmas tree, please help me…
No, we will not help you to do that ;)
Well, joke apart, technically to change the color of of button, you need to subclass NSButton and NSButton Cell… because the only "official" way to change color of buttons is by selecting a different theme.
But if you make your own button classes you can do whatever you want.
If changing only the color of the text is enough for your needs, this snippet should do the job:

@implementation NSButtonCell(SetTextColor)

- (void)setTextColor:(NSColor *)inColor
{
NSMutableAttributedString *title = [[self attributedTitle] mutableCopy] ;

[title addAttribute:NSForegroundColorAttributeName value:inColor range:NSMakeRange(0,[title length])] ;
[self setAttributedTitle:title] ;
}

- (void)setAlternateTextColor:(NSColor *)inColor
{
NSMutableAttributedString *title = [[self attributedAlternateTitle] mutableCopy] ;

[title addAttribute:NSForegroundColorAttributeName value:inColor range:NSMakeRange(0,[title length])] ;
[self setAttributedAlternateTitle:title] ;
}

@end
And changing the background color ?
No: settting the NSBackgroundColorAttributeName will not change the color of the button itself…