Changeset 5972


Ignore:
Timestamp:
May 29, 2008, 9:50:16 PM (13 years ago)
Author:
livings124
Message:

pieces bar color adjustment; dead code removal

Location:
trunk/macosx
Files:
4 edited

Legend:

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

    r5797 r5972  
    3636+ (id)gradientWithBeginningColor:(NSColor *)begin endingColor:(NSColor *)end;
    3737
    38 + (id)aquaSelectedGradient;
    39 + (id)aquaNormalGradient;
    40 + (id)aquaPressedGradient;
    41 
    42 + (id)unifiedSelectedGradient;
    43 + (id)unifiedNormalGradient;
    44 + (id)unifiedPressedGradient;
    45 + (id)unifiedDarkGradient;
    46 
    47 + (id)sourceListSelectedGradient;
    48 + (id)sourceListUnselectedGradient;
    49 
    50 + (id)rainbowGradient;
    51 + (id)hydrogenSpectrumGradient;
    52 
    5338- (CTGradient *)gradientWithAlphaComponent:(float)alpha;
    5439
  • trunk/macosx/CTGradient/CTGradient.m

    r5797 r5972  
    156156  return [newInstance autorelease];
    157157  }
    158 
    159 + (id)aquaSelectedGradient
    160   {
    161   id newInstance = [[[self class] alloc] init];
    162  
    163   CTGradientElement color1;
    164   color1.red   = 0.58;
    165   color1.green = 0.86;
    166   color1.blue  = 0.98;
    167   color1.alpha = 1.00;
    168   color1.position = 0;
    169  
    170   CTGradientElement color2;
    171   color2.red   = 0.42;
    172   color2.green = 0.68;
    173   color2.blue  = 0.90;
    174   color2.alpha = 1.00;
    175   color2.position = 11.5/23;
    176  
    177   CTGradientElement color3;
    178   color3.red   = 0.64;
    179   color3.green = 0.80;
    180   color3.blue  = 0.94;
    181   color3.alpha = 1.00;
    182   color3.position = 11.5/23;
    183  
    184   CTGradientElement color4;
    185   color4.red   = 0.56;
    186   color4.green = 0.70;
    187   color4.blue  = 0.90;
    188   color4.alpha = 1.00;
    189   color4.position = 1;
    190  
    191   [newInstance addElement:&color1];
    192   [newInstance addElement:&color2];
    193   [newInstance addElement:&color3];
    194   [newInstance addElement:&color4];
    195  
    196   return [newInstance autorelease];
    197   }
    198 
    199 + (id)aquaNormalGradient
    200   {
    201   id newInstance = [[[self class] alloc] init];
    202  
    203   CTGradientElement color1;
    204   color1.red = color1.green = color1.blue  = 0.95;
    205   color1.alpha = 1.00;
    206   color1.position = 0;
    207  
    208   CTGradientElement color2;
    209   color2.red = color2.green = color2.blue  = 0.83;
    210   color2.alpha = 1.00;
    211   color2.position = 11.5/23;
    212  
    213   CTGradientElement color3;
    214   color3.red = color3.green = color3.blue  = 0.95;
    215   color3.alpha = 1.00;
    216   color3.position = 11.5/23;
    217  
    218   CTGradientElement color4;
    219   color4.red = color4.green = color4.blue  = 0.92;
    220   color4.alpha = 1.00;
    221   color4.position = 1;
    222  
    223   [newInstance addElement:&color1];
    224   [newInstance addElement:&color2];
    225   [newInstance addElement:&color3];
    226   [newInstance addElement:&color4];
    227  
    228   return [newInstance autorelease];
    229   }
    230 
    231 + (id)aquaPressedGradient
    232   {
    233   id newInstance = [[[self class] alloc] init];
    234  
    235   CTGradientElement color1;
    236   color1.red = color1.green = color1.blue  = 0.80;
    237   color1.alpha = 1.00;
    238   color1.position = 0;
    239  
    240   CTGradientElement color2;
    241   color2.red = color2.green = color2.blue  = 0.64;
    242   color2.alpha = 1.00;
    243   color2.position = 11.5/23;
    244  
    245   CTGradientElement color3;
    246   color3.red = color3.green = color3.blue  = 0.80;
    247   color3.alpha = 1.00;
    248   color3.position = 11.5/23;
    249  
    250   CTGradientElement color4;
    251   color4.red = color4.green = color4.blue  = 0.77;
    252   color4.alpha = 1.00;
    253   color4.position = 1;
    254  
    255   [newInstance addElement:&color1];
    256   [newInstance addElement:&color2];
    257   [newInstance addElement:&color3];
    258   [newInstance addElement:&color4];
    259  
    260   return [newInstance autorelease];
    261   }
    262 
    263 + (id)unifiedSelectedGradient
    264   {
    265   id newInstance = [[[self class] alloc] init];
    266  
    267   CTGradientElement color1;
    268   color1.red = color1.green = color1.blue  = 0.85;
    269   color1.alpha = 1.00;
    270   color1.position = 0;
    271  
    272   CTGradientElement color2;
    273   color2.red = color2.green = color2.blue  = 0.95;
    274   color2.alpha = 1.00;
    275   color2.position = 1;
    276  
    277   [newInstance addElement:&color1];
    278   [newInstance addElement:&color2];
    279  
    280   return [newInstance autorelease];
    281   }
    282 
    283 + (id)unifiedNormalGradient
    284   {
    285   id newInstance = [[[self class] alloc] init];
    286  
    287   CTGradientElement color1;
    288   color1.red = color1.green = color1.blue  = 0.75;
    289   color1.alpha = 1.00;
    290   color1.position = 0;
    291  
    292   CTGradientElement color2;
    293   color2.red = color2.green = color2.blue  = 0.90;
    294   color2.alpha = 1.00;
    295   color2.position = 1;
    296  
    297   [newInstance addElement:&color1];
    298   [newInstance addElement:&color2];
    299  
    300   return [newInstance autorelease];
    301   }
    302 
    303 + (id)unifiedPressedGradient
    304   {
    305   id newInstance = [[[self class] alloc] init];
    306  
    307   CTGradientElement color1;
    308   color1.red = color1.green = color1.blue  = 0.60;
    309   color1.alpha = 1.00;
    310   color1.position = 0;
    311  
    312   CTGradientElement color2;
    313   color2.red = color2.green = color2.blue  = 0.75;
    314   color2.alpha = 1.00;
    315   color2.position = 1;
    316  
    317   [newInstance addElement:&color1];
    318   [newInstance addElement:&color2];
    319  
    320   return [newInstance autorelease];
    321   }
    322 
    323 + (id)unifiedDarkGradient
    324   {
    325   id newInstance = [[[self class] alloc] init];
    326  
    327   CTGradientElement color1;
    328   color1.red = color1.green = color1.blue  = 0.68;
    329   color1.alpha = 1.00;
    330   color1.position = 0;
    331  
    332   CTGradientElement color2;
    333   color2.red = color2.green = color2.blue  = 0.83;
    334   color2.alpha = 1.00;
    335   color2.position = 1;
    336  
    337   [newInstance addElement:&color1];
    338   [newInstance addElement:&color2];
    339  
    340   return [newInstance autorelease];
    341   }
    342 
    343 + (id)sourceListSelectedGradient
    344   {
    345   id newInstance = [[[self class] alloc] init];
    346  
    347   CTGradientElement color1;
    348   color1.red   = 0.06;
    349   color1.green = 0.37;
    350   color1.blue  = 0.85;
    351   color1.alpha = 1.00;
    352   color1.position = 0;
    353  
    354   CTGradientElement color2;
    355   color2.red   = 0.30;
    356   color2.green = 0.60;
    357   color2.blue  = 0.92;
    358   color2.alpha = 1.00;
    359   color2.position = 1;
    360  
    361   [newInstance addElement:&color1];
    362   [newInstance addElement:&color2];
    363  
    364   return [newInstance autorelease];
    365   }
    366 
    367 + (id)sourceListUnselectedGradient
    368   {
    369   id newInstance = [[[self class] alloc] init];
    370  
    371   CTGradientElement color1;
    372   color1.red   = 0.43;
    373   color1.green = 0.43;
    374   color1.blue  = 0.43;
    375   color1.alpha = 1.00;
    376   color1.position = 0;
    377  
    378   CTGradientElement color2;
    379   color2.red   = 0.60;
    380   color2.green = 0.60;
    381   color2.blue  = 0.60;
    382   color2.alpha = 1.00;
    383   color2.position = 1;
    384  
    385   [newInstance addElement:&color1];
    386   [newInstance addElement:&color2];
    387  
    388   return [newInstance autorelease];
    389   }
    390 
    391 + (id)rainbowGradient
    392   {
    393   id newInstance = [[[self class] alloc] init];
    394  
    395   CTGradientElement color1;
    396   color1.red   = 1.00;
    397   color1.green = 0.00;
    398   color1.blue  = 0.00;
    399   color1.alpha = 1.00;
    400   color1.position = 0.0;
    401  
    402   CTGradientElement color2;
    403   color2.red   = 0.54;
    404   color2.green = 0.00;
    405   color2.blue  = 1.00;
    406   color2.alpha = 1.00;
    407   color2.position = 1.0;
    408    
    409   [newInstance addElement:&color1];
    410   [newInstance addElement:&color2];
    411  
    412   [newInstance setBlendingMode:CTChromaticBlendingMode];
    413  
    414   return [newInstance autorelease];
    415   }
    416 
    417 + (id)hydrogenSpectrumGradient
    418   {
    419   id newInstance = [[[self class] alloc] init];
    420  
    421   struct {float hue; float position; float width;} colorBands[4];
    422  
    423   colorBands[0].hue = 22;
    424   colorBands[0].position = .145;
    425   colorBands[0].width = .01;
    426  
    427   colorBands[1].hue = 200;
    428   colorBands[1].position = .71;
    429   colorBands[1].width = .008;
    430  
    431   colorBands[2].hue = 253;
    432   colorBands[2].position = .885;
    433   colorBands[2].width = .005;
    434  
    435   colorBands[3].hue = 275;
    436   colorBands[3].position = .965;
    437   colorBands[3].width = .003;
    438  
    439   int i;
    440   /////////////////////////////
    441   for(i = 0; i < 4; i++)
    442         {       
    443         float color[4];
    444         color[0] = colorBands[i].hue - 180*colorBands[i].width;
    445         color[1] = 1;
    446         color[2] = 0.001;
    447         color[3] = 1;
    448         transformHSV_RGB(color);
    449         CTGradientElement fadeIn;
    450         fadeIn.red   = color[0];
    451         fadeIn.green = color[1];
    452         fadeIn.blue  = color[2];
    453         fadeIn.alpha = color[3];
    454         fadeIn.position = colorBands[i].position - colorBands[i].width;
    455        
    456        
    457         color[0] = colorBands[i].hue;
    458         color[1] = 1;
    459         color[2] = 1;
    460         color[3] = 1;
    461         transformHSV_RGB(color);
    462         CTGradientElement band;
    463         band.red   = color[0];
    464         band.green = color[1];
    465         band.blue  = color[2];
    466         band.alpha = color[3];
    467         band.position = colorBands[i].position;
    468        
    469         color[0] = colorBands[i].hue + 180*colorBands[i].width;
    470         color[1] = 1;
    471         color[2] = 0.001;
    472         color[3] = 1;
    473         transformHSV_RGB(color);
    474         CTGradientElement fadeOut;
    475         fadeOut.red   = color[0];
    476         fadeOut.green = color[1];
    477         fadeOut.blue  = color[2];
    478         fadeOut.alpha = color[3];
    479         fadeOut.position = colorBands[i].position + colorBands[i].width;
    480        
    481        
    482         [newInstance addElement:&fadeIn];
    483         [newInstance addElement:&band];
    484         [newInstance addElement:&fadeOut];
    485         }
    486  
    487   [newInstance setBlendingMode:CTChromaticBlendingMode];
    488  
    489   return [newInstance autorelease];
    490   }
    491 
    492158#pragma mark -
    493 
    494159
    495160
  • trunk/macosx/CTGradient/CTGradientAdditions.m

    r5941 r5972  
    3939    color2.red = color2.green = color2.blue  = 0.83;
    4040    color2.alpha = 1.00;
    41     color2.position = 11.5/23;
     41    color2.position = 0.5;
    4242   
    4343    CTGradientElement color3;
    4444    color3.red = color3.green = color3.blue  = 0.95;
    4545    color3.alpha = 1.00;
    46     color3.position = 11.5/23;
     46    color3.position = 0.5;
    4747   
    4848    CTGradientElement color4;
     
    325325+ (CTGradient *)progressRedGradient
    326326{
    327  CTGradient *newInstance = [[[self class] alloc] init];
     327    CTGradient *newInstance = [[[self class] alloc] init];
    328328   
    329329        CTGradientElement color1;
     
    349349        color4.green = color4.blue  = 0.5;
    350350    color4.alpha = 1.00;
    351     color4.position = 1;   
     351    color4.position = 1;
     352   
    352353    [newInstance addElement:&color1];
    353354    [newInstance addElement:&color2];
  • trunk/macosx/TorrentCell.m

    r5950 r5972  
    9999       
    100100        //store box colors
    101         fGrayColor = [[NSColor colorWithCalibratedRed: 0.9 green: 0.9 blue: 0.9 alpha: 1.0] retain];
     101        fGrayColor = [[NSColor colorWithCalibratedRed: 0.95 green: 0.95 blue: 0.95 alpha: 1.0] retain];
    102102        fBlue1Color = [[NSColor colorWithCalibratedRed: 0.8 green: 1.0 blue: 1.0 alpha: 1.0] retain];
    103103        fBlue2Color = [[NSColor colorWithCalibratedRed: 0.6 green: 1.0 blue: 1.0 alpha: 1.0] retain];
Note: See TracChangeset for help on using the changeset viewer.