1. /**
    
  2.  * Copyright (c) Meta Platforms, Inc. and affiliates.
    
  3.  *
    
  4.  * This source code is licensed under the MIT license found in the
    
  5.  * LICENSE file in the root directory of this source tree.
    
  6.  *
    
  7.  * @flow
    
  8.  */
    
  9. 
    
  10. import {View} from './View';
    
  11. import {COLORS} from '../content-views/constants';
    
  12. 
    
  13. /**
    
  14.  * View that fills its visible area with a CSS color.
    
  15.  */
    
  16. export class BackgroundColorView extends View {
    
  17.   draw(context: CanvasRenderingContext2D) {
    
  18.     const {visibleArea} = this;
    
  19. 
    
  20.     context.fillStyle = COLORS.BACKGROUND;
    
  21.     context.fillRect(
    
  22.       visibleArea.origin.x,
    
  23.       visibleArea.origin.y,
    
  24.       visibleArea.size.width,
    
  25.       visibleArea.size.height,
    
  26.     );
    
  27.   }
    
  28. }