title: Android theming: Set Status Bar color to Action Bar color in Material3
body: <p>I am migrating my app's Material Design theme from V2 (1.4.0) to V3 (1.5.0).</p>
  <p>Unlike <code>Theme.MaterialComponents.DayNight</code>, which had a DarkActionBar sub style that used the Primary color for the Action Bar, <code>Theme.Material3.DayNight</code> doesn't have DarkActionBar sub style.</p>
  <p>I can't figure out what color is used for the Action Bar in the default settings.</p>
  <p>This is how my current app theme shows up:</p>
  <p><a href="https://i.stack.imgur.com/hhqOZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hhqOZ.png" alt="App screenshot" /></a></p>
  <p>As can be seen, my Primary color is Blue, but the Action Bar has automatically been colored using a shade/alpha of the primary. The hexadecimal color notation of the Action Bar was not defined by me. I tried setting the Status Bar to all the various shades of blue that I defined in my colors.xml file, but none of them are a perfect match.</p>
  <p>Can someone explain how is the Action Bar color determined or how I may be able to set the Status Bar to the same color as the Action Bar?</p>
  <p><strong>colors.xml:</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;resources&gt;
      &lt;color name=&quot;black&quot;&gt;#000000&lt;/color&gt;
      &lt;color name=&quot;white&quot;&gt;#ffffff&lt;/color&gt;
  
      &lt;color name=&quot;black_alpha_020&quot;&gt;#33000000&lt;/color&gt;
      &lt;color name=&quot;white_alpha_060&quot;&gt;#99ffffff&lt;/color&gt;
  
      &lt;color name=&quot;blue_50&quot;&gt;#e3f2fd&lt;/color&gt;
      &lt;color name=&quot;blue_50_bit_black&quot;&gt;#E4F0F5&lt;/color&gt;
      &lt;color name=&quot;blue_100&quot;&gt;#bbdefb&lt;/color&gt;
      &lt;color name=&quot;blue_300&quot;&gt;#64b5f6&lt;/color&gt;
      &lt;color name=&quot;blue_500&quot;&gt;#2196f3&lt;/color&gt;
      &lt;color name=&quot;blue_700&quot;&gt;#1976d2&lt;/color&gt;
      &lt;color name=&quot;blue_a100&quot;&gt;#82b1ff&lt;/color&gt;
  
      &lt;color name=&quot;blue_black_3_3&quot;&gt;#072451&lt;/color&gt;
      &lt;color name=&quot;blue_black_3_3_bit_black&quot;&gt;#031228&lt;/color&gt;
      &lt;color name=&quot;blue_white_5_6&quot;&gt;#fafdff&lt;/color&gt;
      &lt;color name=&quot;blue_black_5_6&quot;&gt;#061929&lt;/color&gt;
      &lt;color name=&quot;blue_black_10_2&quot;&gt;#CEDCE6&lt;/color&gt;
      &lt;color name=&quot;blue500_black_5_6&quot;&gt;#26282A&lt;/color&gt;
  
      &lt;color name=&quot;blue_50_alpha_060&quot;&gt;#99e3f2fd&lt;/color&gt;
  
      &lt;color name=&quot;blue_grey_700&quot;&gt;#455a64&lt;/color&gt;
      &lt;color name=&quot;blue_grey_800&quot;&gt;#37474f&lt;/color&gt;
  
      &lt;color name=&quot;amber_100&quot;&gt;#ffecb3&lt;/color&gt;
      &lt;color name=&quot;amber_700&quot;&gt;#ffa000&lt;/color&gt;
      &lt;color name=&quot;amber_black_3_4&quot;&gt;#401C00&lt;/color&gt;
  
      &lt;color name=&quot;red_50&quot;&gt;#ffebee&lt;/color&gt;
      &lt;color name=&quot;red_black_2_3&quot;&gt;#3D0909&lt;/color&gt;
      &lt;color name=&quot;red_900&quot;&gt;#b71c1c&lt;/color&gt;
  
      &lt;color name=&quot;grey_600&quot;&gt;#757575&lt;/color&gt;
  
  &lt;/resources&gt;
  </code></pre>
  <p><strong>themes.xml:</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;resources xmlns:tools=&quot;http://schemas.android.com/tools&quot;&gt;
      &lt;style name=&quot;Theme.SimpleTheme&quot; parent=&quot;Theme.Material3.DayNight&quot;&gt;
          &lt;!--Color--&gt;
          &lt;item name=&quot;colorPrimary&quot;&gt;@color/blue_500&lt;/item&gt;
          &lt;item name=&quot;colorOnPrimary&quot;&gt;@color/white&lt;/item&gt;
          &lt;item name=&quot;colorPrimaryContainer&quot;&gt;@color/blue_50&lt;/item&gt;
          &lt;item name=&quot;colorOnPrimaryContainer&quot;&gt;@color/blue_black_3_3&lt;/item&gt;
  
          &lt;item name=&quot;colorSecondary&quot;&gt;@color/blue_grey_800&lt;/item&gt;
          &lt;item name=&quot;colorOnSecondary&quot;&gt;@color/white&lt;/item&gt;
          &lt;item name=&quot;colorSecondaryContainer&quot;&gt;@color/blue_50_bit_black&lt;/item&gt;
          &lt;item name=&quot;colorOnSecondaryContainer&quot;&gt;@color/blue_black_3_3_bit_black&lt;/item&gt;
  
          &lt;item name=&quot;colorTertiary&quot;&gt;@color/amber_700&lt;/item&gt;
          &lt;item name=&quot;colorOnTertiary&quot;&gt;@color/white&lt;/item&gt;
          &lt;item name=&quot;colorTertiaryContainer&quot;&gt;@color/amber_100&lt;/item&gt;
          &lt;item name=&quot;colorOnTertiaryContainer&quot;&gt;@color/amber_black_3_4&lt;/item&gt;
  
          &lt;item name=&quot;colorError&quot;&gt;@color/red_900&lt;/item&gt;
          &lt;item name=&quot;colorOnError&quot;&gt;@color/white&lt;/item&gt;
          &lt;item name=&quot;colorErrorContainer&quot;&gt;@color/red_50&lt;/item&gt;
          &lt;item name=&quot;colorOnErrorContainer&quot;&gt;@color/red_black_2_3&lt;/item&gt;
  
          &lt;item name=&quot;android:colorBackground&quot;&gt;@color/blue_white_5_6&lt;/item&gt;
          &lt;item name=&quot;colorOnBackground&quot;&gt;@color/blue_black_5_6&lt;/item&gt;
          &lt;item name=&quot;colorSurface&quot;&gt;@color/blue_white_5_6&lt;/item&gt;
          &lt;item name=&quot;colorOnSurface&quot;&gt;@color/blue_black_5_6&lt;/item&gt;
  
          &lt;item name=&quot;colorSurfaceVariant&quot;&gt;@color/blue_black_10_2&lt;/item&gt;
          &lt;item name=&quot;colorOnSurfaceVariant&quot;&gt;@color/blue500_black_5_6&lt;/item&gt;
          &lt;item name=&quot;colorOutline&quot;&gt;@color/grey_600&lt;/item&gt;
  
          &lt;item name=&quot;colorSurfaceInverse&quot;&gt;@color/blue_black_5_6&lt;/item&gt;
          &lt;item name=&quot;colorOnSurfaceInverse&quot;&gt;@color/blue_white_5_6&lt;/item&gt;
          &lt;item name=&quot;colorPrimaryInverse&quot;&gt;@color/blue_a100&lt;/item&gt;
  
          &lt;item name=&quot;android:navigationBarColor&quot; tools:targetApi=&quot;o_mr1&quot;&gt;?attr/colorSurface&lt;/item&gt;
          &lt;item name=&quot;android:windowLightNavigationBar&quot; tools:targetApi=&quot;o_mr1&quot;&gt;true&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;style name=&quot;Theme.SimpleTheme.NoActionBar&quot;&gt;
          &lt;item name=&quot;windowActionBar&quot;&gt;false&lt;/item&gt;
          &lt;item name=&quot;windowNoTitle&quot;&gt;true&lt;/item&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>