Polychromatic icon indicating copy to clipboard operation
Polychromatic copied to clipboard

YES and NO.

Open ghost opened this issue 10 years ago • 2 comments

It would be nice if YES and NO could be seen in a Red/Green colour.

ghost avatar May 18 '14 16:05 ghost

Will look into this through a more general approach...to allow users to set custom colors for any keyword. I could see people wanting to make, say, "return" or "break" also be red or something.

kolinkrewinkel avatar Mar 23 '15 04:03 kolinkrewinkel

This would be pretty awesome :D

edit:

Here's a temporary approach:

NSString *variable = [[self string] substringWithRange:newRange];
if ([variable isEqualToString:@"false"] || [variable isEqualToString:@"NO"] || [variable isEqualToString:@"break"] || [variable isEqualToString:@"defer"]) {
    return [NSColor colorWithCalibratedRed:0.83 green:0.45 blue:0.59 alpha:1];
}
else if ([variable isEqualToString:@"true"] || [variable isEqualToString:@"YES"] || [variable isEqualToString:@"continue"] || [variable isEqualToString:@"guard"]) {
    return [NSColor colorWithCalibratedRed:0.41 green:0.76 blue:0.57 alpha:1];
}

rolandleth avatar Jun 20 '15 17:06 rolandleth