@@ -454,44 +454,11 @@ - (void)finishPlaceScrollbars
454454 }
455455}
456456
457- - (void )setTablineColorsBasedOnBackground : (NSColor *)back foreground : (NSColor *)fore
458- {
459- // Reset to default tabline colors if user doesn't want auto-generated ones.
460- if ([NSUserDefaults .standardUserDefaults boolForKey: @" MMDefaultTablineColors" ]) {
461- tabline.tablineBgColor = nil ;
462- tabline.tablineFgColor = nil ;
463- tabline.tablineSelBgColor = nil ;
464- tabline.tablineSelFgColor = nil ;
465- tabline.tablineFillFgColor = nil ;
466- return ;
467- }
468-
469- tabline.tablineSelBgColor = back;
470- tabline.tablineSelFgColor = fore;
471-
472- // This is a naïve way of setting colors for the tabline based on the
473- // default background and foreground colors. We get the brightness
474- // component of back and fore and then adjust up or down depending on
475- // whether the color is more or less than 50% bright.
476- CGFloat h, s, b, b2, b3, b4, a;
477-
478- [back getHue: &h saturation: &s brightness: &b alpha: &a];
479- b2 = (b > 0.5 ) ? b - 0.15 : b + 0.15 ;
480- tabline.tablineBgColor = [NSColor colorWithHue: h saturation: s brightness: b2 alpha: a];
481-
482- b3 = (b > 0.5 ) ? b - 0.30 : b + 0.30 ;
483- tabline.tablineFillFgColor = [NSColor colorWithHue: h saturation: s brightness: b3 alpha: a];
484-
485- [fore getHue: &h saturation: &s brightness: &b alpha: &a];
486- b4 = (b2 > 0.5 ) ? b2 - 0.25 : b2 + 0.25 ;
487- tabline.tablineFgColor = [NSColor colorWithHue: h saturation: s brightness: b4 alpha: a];
488- }
489-
490457- (void )setDefaultColorsBackground : (NSColor *)back foreground : (NSColor *)fore
491458{
492459 [textView setDefaultColorsBackground: back foreground: fore];
493460
494- [self setTablineColorsBasedOnBackground : back foreground: fore];
461+ [tabline setTablineSelBackground : back foreground: fore];
495462
496463 CALayer *backedLayer = [self layer ];
497464 if (backedLayer) {
0 commit comments