Home | History | Annotate | Download | only in canvas2d_balls_common
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 var backGradient;
      5 function prepareBackground() {
      6   backGradient = canvasContext.createLinearGradient(0, 0, canvasWidth, 0);
      7   backGradient.addColorStop(0, "#FF4040");
      8   backGradient.addColorStop(1, "#40FF40");
      9 }
     10 
     11 function drawBackground() {
     12   canvasContext.save();
     13   canvasContext.fillStyle = backGradient;
     14   canvasContext.fillRect(0, 0, canvasWidth, canvasHeight);
     15   canvasContext.restore();
     16 }
     17