Path: blob/trunk/third_party/closure/goog/graphics/solidfill.js
2868 views
// Copyright 2007 The Closure Library Authors. All Rights Reserved.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// http://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is distributed on an "AS-IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.131415/**16* @fileoverview Represents a solid color fill goog.graphics.17* @author [email protected] (Erik Arvidsson)18*/192021goog.provide('goog.graphics.SolidFill');222324goog.require('goog.graphics.Fill');25262728/**29* Creates an immutable solid color fill object.30*31* @param {string} color The color of the background.32* @param {number=} opt_opacity The opacity of the background fill. The value33* must be greater than or equal to zero (transparent) and less than or34* equal to 1 (opaque).35* @constructor36* @extends {goog.graphics.Fill}37* @deprecated goog.graphics is deprecated. It existed to abstract over browser38* differences before the canvas tag was widely supported. See39* http://en.wikipedia.org/wiki/Canvas_element for details.40*/41goog.graphics.SolidFill = function(color, opt_opacity) {42/**43* The color with which to fill.44* @type {string}45* @private46*/47this.color_ = color;484950/**51* The opacity of the fill.52* @type {number}53* @private54*/55this.opacity_ = opt_opacity == null ? 1.0 : opt_opacity;56};57goog.inherits(goog.graphics.SolidFill, goog.graphics.Fill);585960/**61* @return {string} The color of this fill.62*/63goog.graphics.SolidFill.prototype.getColor = function() {64return this.color_;65};666768/**69* @return {number} The opacity of this fill.70*/71goog.graphics.SolidFill.prototype.getOpacity = function() {72return this.opacity_;73};747576