statusLineStyle function

Style statusLineStyle(
  1. StatusLineRoleKey key, {
  2. required TuiTheme theme,
  3. required bool idle,
  4. double brandT = 1.0,
})

The write-time color seam: resolves one span's role key onto the CURRENT theme (FaThemeController.current at the writer), applying the idle dim and the pi brand fade blend. Pure given its arguments; the S3 band writer calls this per span as it emits SGR.

Implementation

Style statusLineStyle(
  StatusLineRoleKey key, {
  required TuiTheme theme,
  required bool idle,
  double brandT = 1.0,
}) {
  final base = kStatusLineRoles[key]!(theme);
  if (key == StatusLineRoleKey.autopilot) {
    // gh-946: the highlight IS the point — it never dims, so an idle
    // autopilot session keeps reading as "this will not ask you".
    return base;
  }
  if (key == StatusLineRoleKey.brandA || key == StatusLineRoleKey.brandB) {
    if (brandT >= 1) return base;
    final dim = theme.muted;
    final from = dim.foregroundRgb;
    final to = base.foregroundRgb;
    if (from == null || to == null) return brandT < 0.5 ? dim : base;
    return Style(
      foregroundRgb: RgbColor(
        (from.r + (to.r - from.r) * brandT).round(),
        (from.g + (to.g - from.g) * brandT).round(),
        (from.b + (to.b - from.b) * brandT).round(),
      ),
    );
  }
  return idle ? theme.muted : base;
}