Changeset 6250


Ignore:
Timestamp:
Jun 24, 2008, 7:36:25 PM (13 years ago)
Author:
livings124
Message:

some more adjustments to the progress bar gradient

Location:
trunk/macosx/CTGradient
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/CTGradient/CTGradientAdditions.h

    r6246 r6250  
    2727@interface CTGradient (ProgressBar)
    2828
    29 + (CTGradient *) progressGradientForColor: (NSColor *) color;
     29+ (CTGradient *) progressGradientForRed: (float) redComponent green: (float) greenComponent blue: (float) blueComponent;
    3030
    3131+ (CTGradient *)progressWhiteGradient;
  • trunk/macosx/CTGradient/CTGradientAdditions.m

    r6248 r6250  
    2727@implementation CTGradient (ProgressBar)
    2828
    29 + (CTGradient *) progressGradientForColor: (NSColor *) color
     29+ (CTGradient *) progressGradientForRed: (float) redComponent green: (float) greenComponent blue: (float) blueComponent
    3030{
    31     float redComponent = [color redComponent], greenComponent = [color greenComponent], blueComponent = [color blueComponent];
    32    
    3331    CTGradientElement color1;
    34     color1.red = redComponent * 0.9684;
    35     color1.green = greenComponent * 0.9684;
    36     color1.blue = blueComponent * 0.9684;
     32    color1.red = redComponent * 0.95;
     33    color1.green = greenComponent * 0.95;
     34    color1.blue = blueComponent * 0.95;
    3735    color1.alpha = 1.0;
    3836    color1.position = 0.0;
     
    4644   
    4745    CTGradientElement color3;
    48     color3.red = redComponent * 0.8736;
    49     color3.green = greenComponent * 0.8736;
    50     color3.blue = blueComponent * 0.8736;
     46    color3.red = redComponent * 0.8;
     47    color3.green = greenComponent * 0.8;
     48    color3.blue = blueComponent * 0.8;
    5149    color3.alpha = 1.0;
    5250    color3.position = 0.5;
     
    6058   
    6159    CTGradient * newInstance = [[[self class] alloc] init];
    62     [newInstance addElement:&color1];
    63     [newInstance addElement:&color2];
    64     [newInstance addElement:&color3];
    65     [newInstance addElement:&color4];
     60    [newInstance addElement: &color1];
     61    [newInstance addElement: &color2];
     62    [newInstance addElement: &color3];
     63    [newInstance addElement: &color4];
    6664   
    6765    return [newInstance autorelease];
     
    7068+ (CTGradient *)progressWhiteGradient
    7169{
    72     return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.95 green: 0.95 blue: 0.95 alpha: 1.0]];
     70    return [[self class] progressGradientForRed: 0.95 green: 0.95 blue: 0.95];
    7371}
    7472
    7573+ (CTGradient *)progressGrayGradient
    7674{
    77     return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.7 green: 0.7 blue: 0.7 alpha: 1.0]];
     75    return [[self class] progressGradientForRed: 0.7 green: 0.7 blue: 0.7];
    7876}
    7977
    8078+ (CTGradient *)progressLightGrayGradient
    8179{
    82     return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.87 green: 0.87 blue: 0.87 alpha: 1.0]];
     80    return [[self class] progressGradientForRed: 0.87 green: 0.87 blue: 0.87];
    8381}
    8482
    8583+ (CTGradient *)progressBlueGradient
    8684{
    87     return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.373 green: 0.698 blue: 0.972 alpha: 1.0]];
     85    return [[self class] progressGradientForRed: 0.373 green: 0.698 blue: 0.972];
    8886}
    8987
    9088+ (CTGradient *)progressDarkBlueGradient
    9189{
    92     return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.616 green: 0.722 blue: 0.776 alpha: 1.0]];
     90    return [[self class] progressGradientForRed: 0.616 green: 0.722 blue: 0.776];
    9391}
    9492
    9593+ (CTGradient *)progressGreenGradient
    9694{
    97     return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.384 green: 0.847 blue: 0.310 alpha: 1.0]];
     95    return [[self class] progressGradientForRed: 0.384 green: 0.847 blue: 0.310];
    9896}
    9997
    10098+ (CTGradient *)progressLightGreenGradient
    10199{
    102     return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.780 green: 0.894 blue: 0.729 alpha: 1.0]];
     100    return [[self class] progressGradientForRed: 0.780 green: 0.894 blue: 0.729];
    103101}
    104102
    105103+ (CTGradient *)progressDarkGreenGradient
    106104{
    107     return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.627 green: 0.714 blue: 0.639 alpha: 1.0]];
     105    return [[self class] progressGradientForRed: 0.627 green: 0.714 blue: 0.639];
    108106}
    109107
    110108+ (CTGradient *)progressRedGradient
    111109{
    112     return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.902 green: 0.439 blue: 0.451 alpha: 1.0]];
     110    return [[self class] progressGradientForRed: 0.902 green: 0.439 blue: 0.451];
    113111}
    114112
    115113+ (CTGradient *)progressYellowGradient
    116114{
    117     return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.933 green: 0.890 blue: 0.243 alpha: 1.0]];
     115    return [[self class] progressGradientForRed: 0.933 green: 0.890 blue: 0.243];
    118116}
    119117
Note: See TracChangeset for help on using the changeset viewer.