Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/third_party/closure/goog/graphics/stroke.js
2868 views
1
// Copyright 2007 The Closure Library Authors. All Rights Reserved.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS-IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
16
/**
17
* @fileoverview Represents a stroke object for goog.graphics.
18
* @author [email protected] (Erik Arvidsson)
19
*/
20
21
22
goog.provide('goog.graphics.Stroke');
23
24
25
26
/**
27
* Creates an immutable stroke object.
28
*
29
* @param {number|string} width The width of the stroke.
30
* @param {string} color The color of the stroke.
31
* @param {number=} opt_opacity The opacity of the background fill. The value
32
* must be greater than or equal to zero (transparent) and less than or
33
* equal to 1 (opaque).
34
* @constructor
35
* @deprecated goog.graphics is deprecated. It existed to abstract over browser
36
* differences before the canvas tag was widely supported. See
37
* http://en.wikipedia.org/wiki/Canvas_element for details.
38
*/
39
goog.graphics.Stroke = function(width, color, opt_opacity) {
40
/**
41
* The width of the stroke.
42
* @type {number|string}
43
* @private
44
*/
45
this.width_ = width;
46
47
48
/**
49
* The color with which to fill.
50
* @type {string}
51
* @private
52
*/
53
this.color_ = color;
54
55
56
/**
57
* The opacity of the fill.
58
* @type {number}
59
* @private
60
*/
61
this.opacity_ = opt_opacity == null ? 1.0 : opt_opacity;
62
};
63
64
65
/**
66
* @return {number|string} The width of this stroke.
67
*/
68
goog.graphics.Stroke.prototype.getWidth = function() {
69
return this.width_;
70
};
71
72
73
/**
74
* @return {string} The color of this stroke.
75
*/
76
goog.graphics.Stroke.prototype.getColor = function() {
77
return this.color_;
78
};
79
80
81
/**
82
* @return {number} The opacity of this fill.
83
*/
84
goog.graphics.Stroke.prototype.getOpacity = function() {
85
return this.opacity_;
86
};
87
88