1 2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3<html><head><title>Python: module telemetry.util.rgba_color</title> 4<meta charset="utf-8"> 5</head><body bgcolor="#f0f0f8"> 6 7<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> 8<tr bgcolor="#7799ee"> 9<td valign=bottom> <br> 10<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.util.html"><font color="#ffffff">util</font></a>.rgba_color</strong></big></big></font></td 11><td align=right valign=bottom 12><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/util/rgba_color.py">telemetry/util/rgba_color.py</a></font></td></tr></table> 13 <p><tt># Copyright 2014 The Chromium Authors. All rights reserved.<br> 14# Use of this source code is governed by a BSD-style license that can be<br> 15# found in the LICENSE file.</tt></p> 16<p> 17<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 18<tr bgcolor="#aa55cc"> 19<td colspan=3 valign=bottom> <br> 20<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> 21 22<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> 23<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="collections.html">collections</a><br> 24</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p> 25<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 26<tr bgcolor="#ee77aa"> 27<td colspan=3 valign=bottom> <br> 28<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 29 30<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 31<td width="100%"><dl> 32<dt><font face="helvetica, arial">RgbaColor(<a href="__builtin__.html#tuple">__builtin__.tuple</a>) 33</font></dt><dd> 34<dl> 35<dt><font face="helvetica, arial"><a href="telemetry.util.rgba_color.html#RgbaColor">RgbaColor</a> 36</font></dt></dl> 37</dd> 38</dl> 39 <p> 40<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 41<tr bgcolor="#ffc8d8"> 42<td colspan=3 valign=bottom> <br> 43<font color="#000000" face="helvetica, arial"><a name="RgbaColor">class <strong>RgbaColor</strong></a>(RgbaColor)</font></td></tr> 44 45<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 46<td colspan=2><tt>Encapsulates an RGBA color retrieved from an image.<br> </tt></td></tr> 47<tr><td> </td> 48<td width="100%"><dl><dt>Method resolution order:</dt> 49<dd><a href="telemetry.util.rgba_color.html#RgbaColor">RgbaColor</a></dd> 50<dd>RgbaColor</dd> 51<dd><a href="__builtin__.html#tuple">__builtin__.tuple</a></dd> 52<dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 53</dl> 54<hr> 55Methods defined here:<br> 56<dl><dt><a name="RgbaColor-AssertIsRGB"><strong>AssertIsRGB</strong></a>(self, r, g, b, tolerance<font color="#909090">=0</font>)</dt></dl> 57 58<dl><dt><a name="RgbaColor-AssertIsRGBA"><strong>AssertIsRGBA</strong></a>(self, r, g, b, a, tolerance<font color="#909090">=0</font>)</dt></dl> 59 60<dl><dt><a name="RgbaColor-IsEqual"><strong>IsEqual</strong></a>(self, expected_color, tolerance<font color="#909090">=0</font>)</dt><dd><tt>Verifies that the color is within a given tolerance of<br> 61the expected color.</tt></dd></dl> 62 63<dl><dt><a name="RgbaColor-__int__"><strong>__int__</strong></a>(self)</dt></dl> 64 65<hr> 66Static methods defined here:<br> 67<dl><dt><a name="RgbaColor-__new__"><strong>__new__</strong></a>(cls, r, g, b, a<font color="#909090">=255</font>)</dt></dl> 68 69<hr> 70Data descriptors defined here:<br> 71<dl><dt><strong>__dict__</strong></dt> 72<dd><tt>dictionary for instance variables (if defined)</tt></dd> 73</dl> 74<hr> 75Methods inherited from RgbaColor:<br> 76<dl><dt><a name="RgbaColor-__getnewargs__"><strong>__getnewargs__</strong></a>(self)</dt><dd><tt>Return self as a plain tuple. Used by copy and pickle.</tt></dd></dl> 77 78<dl><dt><a name="RgbaColor-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Exclude the OrderedDict from pickling</tt></dd></dl> 79 80<dl><dt><a name="RgbaColor-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Return a nicely formatted representation string</tt></dd></dl> 81 82<dl><dt><a name="RgbaColor-_asdict"><strong>_asdict</strong></a>(self)</dt><dd><tt>Return a new OrderedDict which maps field names to their values</tt></dd></dl> 83 84<dl><dt><a name="RgbaColor-_replace"><strong>_replace</strong></a>(_self, **kwds)</dt><dd><tt>Return a new <a href="#RgbaColor">RgbaColor</a> object replacing specified fields with new values</tt></dd></dl> 85 86<hr> 87Class methods inherited from RgbaColor:<br> 88<dl><dt><a name="RgbaColor-_make"><strong>_make</strong></a>(cls, iterable, new<font color="#909090">=<built-in method __new__ of type object></font>, len<font color="#909090">=<built-in function len></font>)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Make a new <a href="#RgbaColor">RgbaColor</a> object from a sequence or iterable</tt></dd></dl> 89 90<hr> 91Data descriptors inherited from RgbaColor:<br> 92<dl><dt><strong>a</strong></dt> 93<dd><tt>Alias for field number 3</tt></dd> 94</dl> 95<dl><dt><strong>b</strong></dt> 96<dd><tt>Alias for field number 2</tt></dd> 97</dl> 98<dl><dt><strong>g</strong></dt> 99<dd><tt>Alias for field number 1</tt></dd> 100</dl> 101<dl><dt><strong>r</strong></dt> 102<dd><tt>Alias for field number 0</tt></dd> 103</dl> 104<hr> 105Data and other attributes inherited from RgbaColor:<br> 106<dl><dt><strong>_fields</strong> = ('r', 'g', 'b', 'a')</dl> 107 108<hr> 109Methods inherited from <a href="__builtin__.html#tuple">__builtin__.tuple</a>:<br> 110<dl><dt><a name="RgbaColor-__add__"><strong>__add__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__add__">__add__</a>(y) <==> x+y</tt></dd></dl> 111 112<dl><dt><a name="RgbaColor-__contains__"><strong>__contains__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__contains__">__contains__</a>(y) <==> y in x</tt></dd></dl> 113 114<dl><dt><a name="RgbaColor-__eq__"><strong>__eq__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__eq__">__eq__</a>(y) <==> x==y</tt></dd></dl> 115 116<dl><dt><a name="RgbaColor-__ge__"><strong>__ge__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__ge__">__ge__</a>(y) <==> x>=y</tt></dd></dl> 117 118<dl><dt><a name="RgbaColor-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> 119 120<dl><dt><a name="RgbaColor-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> 121 122<dl><dt><a name="RgbaColor-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> 123 <br> 124Use of negative indices is not supported.</tt></dd></dl> 125 126<dl><dt><a name="RgbaColor-__gt__"><strong>__gt__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__gt__">__gt__</a>(y) <==> x>y</tt></dd></dl> 127 128<dl><dt><a name="RgbaColor-__hash__"><strong>__hash__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__hash__">__hash__</a>() <==> hash(x)</tt></dd></dl> 129 130<dl><dt><a name="RgbaColor-__iter__"><strong>__iter__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__iter__">__iter__</a>() <==> iter(x)</tt></dd></dl> 131 132<dl><dt><a name="RgbaColor-__le__"><strong>__le__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__le__">__le__</a>(y) <==> x<=y</tt></dd></dl> 133 134<dl><dt><a name="RgbaColor-__len__"><strong>__len__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__len__">__len__</a>() <==> len(x)</tt></dd></dl> 135 136<dl><dt><a name="RgbaColor-__lt__"><strong>__lt__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__lt__">__lt__</a>(y) <==> x<y</tt></dd></dl> 137 138<dl><dt><a name="RgbaColor-__mul__"><strong>__mul__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__mul__">__mul__</a>(n) <==> x*n</tt></dd></dl> 139 140<dl><dt><a name="RgbaColor-__ne__"><strong>__ne__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__ne__">__ne__</a>(y) <==> x!=y</tt></dd></dl> 141 142<dl><dt><a name="RgbaColor-__rmul__"><strong>__rmul__</strong></a>(...)</dt><dd><tt>x.<a href="#RgbaColor-__rmul__">__rmul__</a>(n) <==> n*x</tt></dd></dl> 143 144<dl><dt><a name="RgbaColor-__sizeof__"><strong>__sizeof__</strong></a>(...)</dt><dd><tt>T.<a href="#RgbaColor-__sizeof__">__sizeof__</a>() -- size of T in memory, in bytes</tt></dd></dl> 145 146<dl><dt><a name="RgbaColor-count"><strong>count</strong></a>(...)</dt><dd><tt>T.<a href="#RgbaColor-count">count</a>(value) -> integer -- return number of occurrences of value</tt></dd></dl> 147 148<dl><dt><a name="RgbaColor-index"><strong>index</strong></a>(...)</dt><dd><tt>T.<a href="#RgbaColor-index">index</a>(value, [start, [stop]]) -> integer -- return first index of value.<br> 149Raises ValueError if the value is not present.</tt></dd></dl> 150 151</td></tr></table></td></tr></table><p> 152<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 153<tr bgcolor="#55aa55"> 154<td colspan=3 valign=bottom> <br> 155<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> 156 157<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> 158<td width="100%"><strong>WEB_PAGE_TEST_ORANGE</strong> = RgbaColor(r=222, g=100, b=13, a=255)<br> 159<strong>WHITE</strong> = RgbaColor(r=255, g=255, b=255, a=255)</td></tr></table> 160</body></html>