## These def's were a kludge to make programs mostly work, when run with ## the broken version of pyopengl provided by SuSE. #def glutKeyboardUpFunc(a): pass #def glutSpecialFunc(a): pass #def glutSpecialUpFunc(a): pass #def glutIgnoreKeyRepeat(a): pass #[MIT license:] # # Copyright (c) 2004 Dave Pape # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * import operator, math, types, string # Vector class is based in part on public domain matfunc.py, by Raymond Hettinger, # from http://users.rcn.com/python/download/python.htm class Vector(list): concat = list.__add__ # A substitute for the overridden __add__ method def __getslice__( self, i, j ): return Vector( list.__getslice__(self,i,j) ) def __init__( self, elems ): list.__init__( self, elems ) def __str__( self ): return ' '.join( map(str, self) ) def map( self, op, rhs=None ): if rhs is None: # Unary case return Vector( map(op, self) ) elif isinstance(rhs, types.ListType): # List / List op assert len(self) == len(rhs), 'Vector operation requires lengths to agree' return Vector( map(op, self, rhs) ) else: # List / Scalar op return Vector( [op(e,rhs) for e in self] ) def __mul__( self, rhs ): return self.map( operator.mul, rhs ) def __div__( self, rhs ): return self.map( operator.div, rhs ) def __sub__( self, rhs ): return self.map( operator.sub, rhs ) def __add__( self, rhs ): return self.map( operator.add, rhs ) def __rmul__( self, lhs ): return self.map( operator.mul, lhs ) def __rdiv__( self, lhs ): return self.map( lambda x,y: y / x, lhs ) def __rsub__( self, lhs ): return self.map( lambda x,y: y - x, lhs ) def __radd__( self, lhs ): return self.map( operator.mul, lhs ) def __abs__( self ): return self.map( abs ) def __neg__( self ): return self.map( operator.neg ) def __iadd__( self, other ): self = self + other return self def __imul__( self, other ): self = self * other return self def dot( self, otherVec ): return reduce(operator.add, map(operator.mul, self, otherVec), 0.0) def length( self ): return math.sqrt(self.dot(self)) def lengthSquared( self ): return self.dot(self) def normalize( self ): s = 1.0/self.length() # For some Pythonic reason, doing "self *= s" doesn't work for i in range(0,len(self)): self[i] *= s def cross( self, otherVec ): 'Compute a cross product with another vector' assert len(self) == len(otherVec) == 3, 'Cross product only defined for 3-D vectors' u, v = self, otherVec return Vector([ u[1]*v[2]-u[2]*v[1], u[2]*v[0]-u[0]*v[2], u[0]*v[1]-u[1]*v[0] ]) def distance( self, otherVec ): return (self-otherVec).length() def distanceSquared( self, otherVec ): return (self-otherVec).lengthSquared() def drawLine( self ): glBegin(GL_LINES) glVertex3f(0, 0, 0) if len(self) > 2: glVertex3fv(self) elif len(self) == 2: glVertex2fv(self) glEnd() X_Axis = Vector([1, 0, 0]) Y_Axis = Vector([0, 1, 0]) Z_Axis = Vector([0, 0, 1]) class Color(Vector): def apply(self): if len(self) > 3: glColor4fv(self) else: glColor3fv(self) def disable(self): pass def clear(self, otherBits = GL_DEPTH_BUFFER_BIT): if len(self) > 3: glClearColor(self[0], self[1], self[2], self[3]) else: glClearColor(self[0], self[1], self[2], 0) glClear(GL_COLOR_BUFFER_BIT | otherBits) Color.White = Color([1, 1, 1, 1]) Color.Black = Color([0, 0, 0, 1]) Color.Red = Color([1, 0, 0, 1]) Color.Green = Color([0, 1, 0, 1]) Color.Blue = Color([0, 0, 1, 1]) Color.Cyan = Color([0, 1, 1, 1]) Color.Magenta = Color([1, 0, 1, 1]) Color.Yellow = Color([1, 1, 0, 1]) Color.Grey10 = Color([0.1, 0.1, 0.1, 1]) Color.Grey20 = Color([0.2, 0.2, 0.2, 1]) Color.Grey30 = Color([0.3, 0.3, 0.3, 1]) Color.Grey40 = Color([0.4, 0.4, 0.4, 1]) Color.Grey50 = Color([0.5, 0.5, 0.5, 1]) Color.Grey60 = Color([0.6, 0.6, 0.6, 1]) Color.Grey70 = Color([0.7, 0.7, 0.7, 1]) Color.Grey80 = Color([0.8, 0.8, 0.8, 1]) Color.Grey90 = Color([0.9, 0.9, 0.9, 1]) Color.X11 = { 'snow': Color([ 1.0 , 0.980392156863 , 0.980392156863 , 1 ]), 'GhostWhite': Color([ 0.972549019608 , 0.972549019608 , 1.0 , 1 ]), 'WhiteSmoke': Color([ 0.960784313725 , 0.960784313725 , 0.960784313725 , 1 ]), 'gainsboro': Color([ 0.862745098039 , 0.862745098039 , 0.862745098039 , 1 ]), 'FloralWhite': Color([ 1.0 , 0.980392156863 , 0.941176470588 , 1 ]), 'OldLace': Color([ 0.992156862745 , 0.960784313725 , 0.901960784314 , 1 ]), 'linen': Color([ 0.980392156863 , 0.941176470588 , 0.901960784314 , 1 ]), 'AntiqueWhite': Color([ 0.980392156863 , 0.921568627451 , 0.843137254902 , 1 ]), 'PapayaWhip': Color([ 1.0 , 0.937254901961 , 0.835294117647 , 1 ]), 'BlanchedAlmond': Color([ 1.0 , 0.921568627451 , 0.803921568627 , 1 ]), 'bisque': Color([ 1.0 , 0.894117647059 , 0.76862745098 , 1 ]), 'PeachPuff': Color([ 1.0 , 0.854901960784 , 0.725490196078 , 1 ]), 'NavajoWhite': Color([ 1.0 , 0.870588235294 , 0.678431372549 , 1 ]), 'moccasin': Color([ 1.0 , 0.894117647059 , 0.709803921569 , 1 ]), 'cornsilk': Color([ 1.0 , 0.972549019608 , 0.862745098039 , 1 ]), 'ivory': Color([ 1.0 , 1.0 , 0.941176470588 , 1 ]), 'LemonChiffon': Color([ 1.0 , 0.980392156863 , 0.803921568627 , 1 ]), 'seashell': Color([ 1.0 , 0.960784313725 , 0.933333333333 , 1 ]), 'honeydew': Color([ 0.941176470588 , 1.0 , 0.941176470588 , 1 ]), 'MintCream': Color([ 0.960784313725 , 1.0 , 0.980392156863 , 1 ]), 'azure': Color([ 0.941176470588 , 1.0 , 1.0 , 1 ]), 'AliceBlue': Color([ 0.941176470588 , 0.972549019608 , 1.0 , 1 ]), 'lavender': Color([ 0.901960784314 , 0.901960784314 , 0.980392156863 , 1 ]), 'LavenderBlush': Color([ 1.0 , 0.941176470588 , 0.960784313725 , 1 ]), 'MistyRose': Color([ 1.0 , 0.894117647059 , 0.882352941176 , 1 ]), 'white': Color([ 1.0 , 1.0 , 1.0 , 1 ]), 'black': Color([ 0.0 , 0.0 , 0.0 , 1 ]), 'DarkSlateGray': Color([ 0.18431372549 , 0.309803921569 , 0.309803921569 , 1 ]), 'DarkSlateGrey': Color([ 0.18431372549 , 0.309803921569 , 0.309803921569 , 1 ]), 'DimGray': Color([ 0.411764705882 , 0.411764705882 , 0.411764705882 , 1 ]), 'DimGrey': Color([ 0.411764705882 , 0.411764705882 , 0.411764705882 , 1 ]), 'SlateGray': Color([ 0.439215686275 , 0.501960784314 , 0.564705882353 , 1 ]), 'SlateGrey': Color([ 0.439215686275 , 0.501960784314 , 0.564705882353 , 1 ]), 'LightSlateGray': Color([ 0.466666666667 , 0.533333333333 , 0.6 , 1 ]), 'LightSlateGrey': Color([ 0.466666666667 , 0.533333333333 , 0.6 , 1 ]), 'gray': Color([ 0.745098039216 , 0.745098039216 , 0.745098039216 , 1 ]), 'grey': Color([ 0.745098039216 , 0.745098039216 , 0.745098039216 , 1 ]), 'LightGrey': Color([ 0.827450980392 , 0.827450980392 , 0.827450980392 , 1 ]), 'LightGray': Color([ 0.827450980392 , 0.827450980392 , 0.827450980392 , 1 ]), 'MidnightBlue': Color([ 0.0980392156863 , 0.0980392156863 , 0.439215686275 , 1 ]), 'navy': Color([ 0.0 , 0.0 , 0.501960784314 , 1 ]), 'NavyBlue': Color([ 0.0 , 0.0 , 0.501960784314 , 1 ]), 'CornflowerBlue': Color([ 0.392156862745 , 0.58431372549 , 0.929411764706 , 1 ]), 'DarkSlateBlue': Color([ 0.282352941176 , 0.239215686275 , 0.545098039216 , 1 ]), 'SlateBlue': Color([ 0.41568627451 , 0.352941176471 , 0.803921568627 , 1 ]), 'MediumSlateBlue': Color([ 0.482352941176 , 0.407843137255 , 0.933333333333 , 1 ]), 'LightSlateBlue': Color([ 0.517647058824 , 0.439215686275 , 1.0 , 1 ]), 'MediumBlue': Color([ 0.0 , 0.0 , 0.803921568627 , 1 ]), 'RoyalBlue': Color([ 0.254901960784 , 0.411764705882 , 0.882352941176 , 1 ]), 'blue': Color([ 0.0 , 0.0 , 1.0 , 1 ]), 'DodgerBlue': Color([ 0.117647058824 , 0.564705882353 , 1.0 , 1 ]), 'DeepSkyBlue': Color([ 0.0 , 0.749019607843 , 1.0 , 1 ]), 'SkyBlue': Color([ 0.529411764706 , 0.807843137255 , 0.921568627451 , 1 ]), 'LightSkyBlue': Color([ 0.529411764706 , 0.807843137255 , 0.980392156863 , 1 ]), 'SteelBlue': Color([ 0.274509803922 , 0.509803921569 , 0.705882352941 , 1 ]), 'LightSteelBlue': Color([ 0.690196078431 , 0.76862745098 , 0.870588235294 , 1 ]), 'LightBlue': Color([ 0.678431372549 , 0.847058823529 , 0.901960784314 , 1 ]), 'PowderBlue': Color([ 0.690196078431 , 0.878431372549 , 0.901960784314 , 1 ]), 'PaleTurquoise': Color([ 0.686274509804 , 0.933333333333 , 0.933333333333 , 1 ]), 'DarkTurquoise': Color([ 0.0 , 0.807843137255 , 0.819607843137 , 1 ]), 'MediumTurquoise': Color([ 0.282352941176 , 0.819607843137 , 0.8 , 1 ]), 'turquoise': Color([ 0.250980392157 , 0.878431372549 , 0.81568627451 , 1 ]), 'cyan': Color([ 0.0 , 1.0 , 1.0 , 1 ]), 'LightCyan': Color([ 0.878431372549 , 1.0 , 1.0 , 1 ]), 'CadetBlue': Color([ 0.372549019608 , 0.619607843137 , 0.627450980392 , 1 ]), 'MediumAquamarine': Color([ 0.4 , 0.803921568627 , 0.666666666667 , 1 ]), 'aquamarine': Color([ 0.498039215686 , 1.0 , 0.83137254902 , 1 ]), 'DarkGreen': Color([ 0.0 , 0.392156862745 , 0.0 , 1 ]), 'DarkOliveGreen': Color([ 0.333333333333 , 0.419607843137 , 0.18431372549 , 1 ]), 'DarkSeaGreen': Color([ 0.560784313725 , 0.737254901961 , 0.560784313725 , 1 ]), 'SeaGreen': Color([ 0.180392156863 , 0.545098039216 , 0.341176470588 , 1 ]), 'MediumSeaGreen': Color([ 0.235294117647 , 0.701960784314 , 0.443137254902 , 1 ]), 'LightSeaGreen': Color([ 0.125490196078 , 0.698039215686 , 0.666666666667 , 1 ]), 'PaleGreen': Color([ 0.596078431373 , 0.98431372549 , 0.596078431373 , 1 ]), 'SpringGreen': Color([ 0.0 , 1.0 , 0.498039215686 , 1 ]), 'LawnGreen': Color([ 0.486274509804 , 0.988235294118 , 0.0 , 1 ]), 'green': Color([ 0.0 , 1.0 , 0.0 , 1 ]), 'chartreuse': Color([ 0.498039215686 , 1.0 , 0.0 , 1 ]), 'MediumSpringGreen': Color([ 0.0 , 0.980392156863 , 0.603921568627 , 1 ]), 'GreenYellow': Color([ 0.678431372549 , 1.0 , 0.18431372549 , 1 ]), 'LimeGreen': Color([ 0.196078431373 , 0.803921568627 , 0.196078431373 , 1 ]), 'YellowGreen': Color([ 0.603921568627 , 0.803921568627 , 0.196078431373 , 1 ]), 'ForestGreen': Color([ 0.133333333333 , 0.545098039216 , 0.133333333333 , 1 ]), 'OliveDrab': Color([ 0.419607843137 , 0.556862745098 , 0.137254901961 , 1 ]), 'DarkKhaki': Color([ 0.741176470588 , 0.717647058824 , 0.419607843137 , 1 ]), 'khaki': Color([ 0.941176470588 , 0.901960784314 , 0.549019607843 , 1 ]), 'PaleGoldenrod': Color([ 0.933333333333 , 0.909803921569 , 0.666666666667 , 1 ]), 'LightGoldenrodYellow': Color([ 0.980392156863 , 0.980392156863 , 0.823529411765 , 1 ]), 'LightYellow': Color([ 1.0 , 1.0 , 0.878431372549 , 1 ]), 'yellow': Color([ 1.0 , 1.0 , 0.0 , 1 ]), 'gold': Color([ 1.0 , 0.843137254902 , 0.0 , 1 ]), 'LightGoldenrod': Color([ 0.933333333333 , 0.866666666667 , 0.509803921569 , 1 ]), 'goldenrod': Color([ 0.854901960784 , 0.647058823529 , 0.125490196078 , 1 ]), 'DarkGoldenrod': Color([ 0.721568627451 , 0.525490196078 , 0.043137254902 , 1 ]), 'RosyBrown': Color([ 0.737254901961 , 0.560784313725 , 0.560784313725 , 1 ]), 'IndianRed': Color([ 0.803921568627 , 0.360784313725 , 0.360784313725 , 1 ]), 'SaddleBrown': Color([ 0.545098039216 , 0.270588235294 , 0.0745098039216 , 1 ]), 'sienna': Color([ 0.627450980392 , 0.321568627451 , 0.176470588235 , 1 ]), 'peru': Color([ 0.803921568627 , 0.521568627451 , 0.247058823529 , 1 ]), 'burlywood': Color([ 0.870588235294 , 0.721568627451 , 0.529411764706 , 1 ]), 'beige': Color([ 0.960784313725 , 0.960784313725 , 0.862745098039 , 1 ]), 'wheat': Color([ 0.960784313725 , 0.870588235294 , 0.701960784314 , 1 ]), 'SandyBrown': Color([ 0.956862745098 , 0.643137254902 , 0.376470588235 , 1 ]), 'tan': Color([ 0.823529411765 , 0.705882352941 , 0.549019607843 , 1 ]), 'chocolate': Color([ 0.823529411765 , 0.411764705882 , 0.117647058824 , 1 ]), 'firebrick': Color([ 0.698039215686 , 0.133333333333 , 0.133333333333 , 1 ]), 'brown': Color([ 0.647058823529 , 0.164705882353 , 0.164705882353 , 1 ]), 'DarkSalmon': Color([ 0.913725490196 , 0.588235294118 , 0.478431372549 , 1 ]), 'salmon': Color([ 0.980392156863 , 0.501960784314 , 0.447058823529 , 1 ]), 'LightSalmon': Color([ 1.0 , 0.627450980392 , 0.478431372549 , 1 ]), 'orange': Color([ 1.0 , 0.647058823529 , 0.0 , 1 ]), 'DarkOrange': Color([ 1.0 , 0.549019607843 , 0.0 , 1 ]), 'coral': Color([ 1.0 , 0.498039215686 , 0.313725490196 , 1 ]), 'LightCoral': Color([ 0.941176470588 , 0.501960784314 , 0.501960784314 , 1 ]), 'tomato': Color([ 1.0 , 0.388235294118 , 0.278431372549 , 1 ]), 'OrangeRed': Color([ 1.0 , 0.270588235294 , 0.0 , 1 ]), 'red': Color([ 1.0 , 0.0 , 0.0 , 1 ]), 'HotPink': Color([ 1.0 , 0.411764705882 , 0.705882352941 , 1 ]), 'DeepPink': Color([ 1.0 , 0.078431372549 , 0.576470588235 , 1 ]), 'pink': Color([ 1.0 , 0.752941176471 , 0.796078431373 , 1 ]), 'LightPink': Color([ 1.0 , 0.713725490196 , 0.756862745098 , 1 ]), 'PaleVioletRed': Color([ 0.858823529412 , 0.439215686275 , 0.576470588235 , 1 ]), 'maroon': Color([ 0.690196078431 , 0.188235294118 , 0.376470588235 , 1 ]), 'MediumVioletRed': Color([ 0.780392156863 , 0.0823529411765 , 0.521568627451 , 1 ]), 'VioletRed': Color([ 0.81568627451 , 0.125490196078 , 0.564705882353 , 1 ]), 'magenta': Color([ 1.0 , 0.0 , 1.0 , 1 ]), 'violet': Color([ 0.933333333333 , 0.509803921569 , 0.933333333333 , 1 ]), 'plum': Color([ 0.866666666667 , 0.627450980392 , 0.866666666667 , 1 ]), 'orchid': Color([ 0.854901960784 , 0.439215686275 , 0.839215686275 , 1 ]), 'MediumOrchid': Color([ 0.729411764706 , 0.333333333333 , 0.827450980392 , 1 ]), 'DarkOrchid': Color([ 0.6 , 0.196078431373 , 0.8 , 1 ]), 'DarkViolet': Color([ 0.580392156863 , 0.0 , 0.827450980392 , 1 ]), 'BlueViolet': Color([ 0.541176470588 , 0.16862745098 , 0.886274509804 , 1 ]), 'purple': Color([ 0.627450980392 , 0.125490196078 , 0.941176470588 , 1 ]), 'MediumPurple': Color([ 0.576470588235 , 0.439215686275 , 0.858823529412 , 1 ]), 'thistle': Color([ 0.847058823529 , 0.749019607843 , 0.847058823529 , 1 ]), 'snow1': Color([ 1.0 , 0.980392156863 , 0.980392156863 , 1 ]), 'snow2': Color([ 0.933333333333 , 0.913725490196 , 0.913725490196 , 1 ]), 'snow3': Color([ 0.803921568627 , 0.788235294118 , 0.788235294118 , 1 ]), 'snow4': Color([ 0.545098039216 , 0.537254901961 , 0.537254901961 , 1 ]), 'seashell1': Color([ 1.0 , 0.960784313725 , 0.933333333333 , 1 ]), 'seashell2': Color([ 0.933333333333 , 0.898039215686 , 0.870588235294 , 1 ]), 'seashell3': Color([ 0.803921568627 , 0.772549019608 , 0.749019607843 , 1 ]), 'seashell4': Color([ 0.545098039216 , 0.525490196078 , 0.509803921569 , 1 ]), 'AntiqueWhite1': Color([ 1.0 , 0.937254901961 , 0.858823529412 , 1 ]), 'AntiqueWhite2': Color([ 0.933333333333 , 0.874509803922 , 0.8 , 1 ]), 'AntiqueWhite3': Color([ 0.803921568627 , 0.752941176471 , 0.690196078431 , 1 ]), 'AntiqueWhite4': Color([ 0.545098039216 , 0.513725490196 , 0.470588235294 , 1 ]), 'bisque1': Color([ 1.0 , 0.894117647059 , 0.76862745098 , 1 ]), 'bisque2': Color([ 0.933333333333 , 0.835294117647 , 0.717647058824 , 1 ]), 'bisque3': Color([ 0.803921568627 , 0.717647058824 , 0.619607843137 , 1 ]), 'bisque4': Color([ 0.545098039216 , 0.490196078431 , 0.419607843137 , 1 ]), 'PeachPuff1': Color([ 1.0 , 0.854901960784 , 0.725490196078 , 1 ]), 'PeachPuff2': Color([ 0.933333333333 , 0.796078431373 , 0.678431372549 , 1 ]), 'PeachPuff3': Color([ 0.803921568627 , 0.686274509804 , 0.58431372549 , 1 ]), 'PeachPuff4': Color([ 0.545098039216 , 0.466666666667 , 0.396078431373 , 1 ]), 'NavajoWhite1': Color([ 1.0 , 0.870588235294 , 0.678431372549 , 1 ]), 'NavajoWhite2': Color([ 0.933333333333 , 0.811764705882 , 0.63137254902 , 1 ]), 'NavajoWhite3': Color([ 0.803921568627 , 0.701960784314 , 0.545098039216 , 1 ]), 'NavajoWhite4': Color([ 0.545098039216 , 0.474509803922 , 0.36862745098 , 1 ]), 'LemonChiffon1': Color([ 1.0 , 0.980392156863 , 0.803921568627 , 1 ]), 'LemonChiffon2': Color([ 0.933333333333 , 0.913725490196 , 0.749019607843 , 1 ]), 'LemonChiffon3': Color([ 0.803921568627 , 0.788235294118 , 0.647058823529 , 1 ]), 'LemonChiffon4': Color([ 0.545098039216 , 0.537254901961 , 0.439215686275 , 1 ]), 'cornsilk1': Color([ 1.0 , 0.972549019608 , 0.862745098039 , 1 ]), 'cornsilk2': Color([ 0.933333333333 , 0.909803921569 , 0.803921568627 , 1 ]), 'cornsilk3': Color([ 0.803921568627 , 0.78431372549 , 0.694117647059 , 1 ]), 'cornsilk4': Color([ 0.545098039216 , 0.533333333333 , 0.470588235294 , 1 ]), 'ivory1': Color([ 1.0 , 1.0 , 0.941176470588 , 1 ]), 'ivory2': Color([ 0.933333333333 , 0.933333333333 , 0.878431372549 , 1 ]), 'ivory3': Color([ 0.803921568627 , 0.803921568627 , 0.756862745098 , 1 ]), 'ivory4': Color([ 0.545098039216 , 0.545098039216 , 0.513725490196 , 1 ]), 'honeydew1': Color([ 0.941176470588 , 1.0 , 0.941176470588 , 1 ]), 'honeydew2': Color([ 0.878431372549 , 0.933333333333 , 0.878431372549 , 1 ]), 'honeydew3': Color([ 0.756862745098 , 0.803921568627 , 0.756862745098 , 1 ]), 'honeydew4': Color([ 0.513725490196 , 0.545098039216 , 0.513725490196 , 1 ]), 'LavenderBlush1': Color([ 1.0 , 0.941176470588 , 0.960784313725 , 1 ]), 'LavenderBlush2': Color([ 0.933333333333 , 0.878431372549 , 0.898039215686 , 1 ]), 'LavenderBlush3': Color([ 0.803921568627 , 0.756862745098 , 0.772549019608 , 1 ]), 'LavenderBlush4': Color([ 0.545098039216 , 0.513725490196 , 0.525490196078 , 1 ]), 'MistyRose1': Color([ 1.0 , 0.894117647059 , 0.882352941176 , 1 ]), 'MistyRose2': Color([ 0.933333333333 , 0.835294117647 , 0.823529411765 , 1 ]), 'MistyRose3': Color([ 0.803921568627 , 0.717647058824 , 0.709803921569 , 1 ]), 'MistyRose4': Color([ 0.545098039216 , 0.490196078431 , 0.482352941176 , 1 ]), 'azure1': Color([ 0.941176470588 , 1.0 , 1.0 , 1 ]), 'azure2': Color([ 0.878431372549 , 0.933333333333 , 0.933333333333 , 1 ]), 'azure3': Color([ 0.756862745098 , 0.803921568627 , 0.803921568627 , 1 ]), 'azure4': Color([ 0.513725490196 , 0.545098039216 , 0.545098039216 , 1 ]), 'SlateBlue1': Color([ 0.513725490196 , 0.435294117647 , 1.0 , 1 ]), 'SlateBlue2': Color([ 0.478431372549 , 0.403921568627 , 0.933333333333 , 1 ]), 'SlateBlue3': Color([ 0.411764705882 , 0.349019607843 , 0.803921568627 , 1 ]), 'SlateBlue4': Color([ 0.278431372549 , 0.235294117647 , 0.545098039216 , 1 ]), 'RoyalBlue1': Color([ 0.282352941176 , 0.462745098039 , 1.0 , 1 ]), 'RoyalBlue2': Color([ 0.262745098039 , 0.43137254902 , 0.933333333333 , 1 ]), 'RoyalBlue3': Color([ 0.227450980392 , 0.372549019608 , 0.803921568627 , 1 ]), 'RoyalBlue4': Color([ 0.152941176471 , 0.250980392157 , 0.545098039216 , 1 ]), 'blue1': Color([ 0.0 , 0.0 , 1.0 , 1 ]), 'blue2': Color([ 0.0 , 0.0 , 0.933333333333 , 1 ]), 'blue3': Color([ 0.0 , 0.0 , 0.803921568627 , 1 ]), 'blue4': Color([ 0.0 , 0.0 , 0.545098039216 , 1 ]), 'DodgerBlue1': Color([ 0.117647058824 , 0.564705882353 , 1.0 , 1 ]), 'DodgerBlue2': Color([ 0.109803921569 , 0.525490196078 , 0.933333333333 , 1 ]), 'DodgerBlue3': Color([ 0.0941176470588 , 0.454901960784 , 0.803921568627 , 1 ]), 'DodgerBlue4': Color([ 0.0627450980392 , 0.305882352941 , 0.545098039216 , 1 ]), 'SteelBlue1': Color([ 0.388235294118 , 0.721568627451 , 1.0 , 1 ]), 'SteelBlue2': Color([ 0.360784313725 , 0.674509803922 , 0.933333333333 , 1 ]), 'SteelBlue3': Color([ 0.309803921569 , 0.580392156863 , 0.803921568627 , 1 ]), 'SteelBlue4': Color([ 0.211764705882 , 0.392156862745 , 0.545098039216 , 1 ]), 'DeepSkyBlue1': Color([ 0.0 , 0.749019607843 , 1.0 , 1 ]), 'DeepSkyBlue2': Color([ 0.0 , 0.698039215686 , 0.933333333333 , 1 ]), 'DeepSkyBlue3': Color([ 0.0 , 0.603921568627 , 0.803921568627 , 1 ]), 'DeepSkyBlue4': Color([ 0.0 , 0.407843137255 , 0.545098039216 , 1 ]), 'SkyBlue1': Color([ 0.529411764706 , 0.807843137255 , 1.0 , 1 ]), 'SkyBlue2': Color([ 0.494117647059 , 0.752941176471 , 0.933333333333 , 1 ]), 'SkyBlue3': Color([ 0.423529411765 , 0.650980392157 , 0.803921568627 , 1 ]), 'SkyBlue4': Color([ 0.290196078431 , 0.439215686275 , 0.545098039216 , 1 ]), 'LightSkyBlue1': Color([ 0.690196078431 , 0.886274509804 , 1.0 , 1 ]), 'LightSkyBlue2': Color([ 0.643137254902 , 0.827450980392 , 0.933333333333 , 1 ]), 'LightSkyBlue3': Color([ 0.552941176471 , 0.713725490196 , 0.803921568627 , 1 ]), 'LightSkyBlue4': Color([ 0.376470588235 , 0.482352941176 , 0.545098039216 , 1 ]), 'SlateGray1': Color([ 0.776470588235 , 0.886274509804 , 1.0 , 1 ]), 'SlateGray2': Color([ 0.725490196078 , 0.827450980392 , 0.933333333333 , 1 ]), 'SlateGray3': Color([ 0.623529411765 , 0.713725490196 , 0.803921568627 , 1 ]), 'SlateGray4': Color([ 0.423529411765 , 0.482352941176 , 0.545098039216 , 1 ]), 'LightSteelBlue1': Color([ 0.792156862745 , 0.882352941176 , 1.0 , 1 ]), 'LightSteelBlue2': Color([ 0.737254901961 , 0.823529411765 , 0.933333333333 , 1 ]), 'LightSteelBlue3': Color([ 0.635294117647 , 0.709803921569 , 0.803921568627 , 1 ]), 'LightSteelBlue4': Color([ 0.43137254902 , 0.482352941176 , 0.545098039216 , 1 ]), 'LightBlue1': Color([ 0.749019607843 , 0.937254901961 , 1.0 , 1 ]), 'LightBlue2': Color([ 0.698039215686 , 0.874509803922 , 0.933333333333 , 1 ]), 'LightBlue3': Color([ 0.603921568627 , 0.752941176471 , 0.803921568627 , 1 ]), 'LightBlue4': Color([ 0.407843137255 , 0.513725490196 , 0.545098039216 , 1 ]), 'LightCyan1': Color([ 0.878431372549 , 1.0 , 1.0 , 1 ]), 'LightCyan2': Color([ 0.819607843137 , 0.933333333333 , 0.933333333333 , 1 ]), 'LightCyan3': Color([ 0.705882352941 , 0.803921568627 , 0.803921568627 , 1 ]), 'LightCyan4': Color([ 0.478431372549 , 0.545098039216 , 0.545098039216 , 1 ]), 'PaleTurquoise1': Color([ 0.733333333333 , 1.0 , 1.0 , 1 ]), 'PaleTurquoise2': Color([ 0.682352941176 , 0.933333333333 , 0.933333333333 , 1 ]), 'PaleTurquoise3': Color([ 0.588235294118 , 0.803921568627 , 0.803921568627 , 1 ]), 'PaleTurquoise4': Color([ 0.4 , 0.545098039216 , 0.545098039216 , 1 ]), 'CadetBlue1': Color([ 0.596078431373 , 0.960784313725 , 1.0 , 1 ]), 'CadetBlue2': Color([ 0.556862745098 , 0.898039215686 , 0.933333333333 , 1 ]), 'CadetBlue3': Color([ 0.478431372549 , 0.772549019608 , 0.803921568627 , 1 ]), 'CadetBlue4': Color([ 0.325490196078 , 0.525490196078 , 0.545098039216 , 1 ]), 'turquoise1': Color([ 0.0 , 0.960784313725 , 1.0 , 1 ]), 'turquoise2': Color([ 0.0 , 0.898039215686 , 0.933333333333 , 1 ]), 'turquoise3': Color([ 0.0 , 0.772549019608 , 0.803921568627 , 1 ]), 'turquoise4': Color([ 0.0 , 0.525490196078 , 0.545098039216 , 1 ]), 'cyan1': Color([ 0.0 , 1.0 , 1.0 , 1 ]), 'cyan2': Color([ 0.0 , 0.933333333333 , 0.933333333333 , 1 ]), 'cyan3': Color([ 0.0 , 0.803921568627 , 0.803921568627 , 1 ]), 'cyan4': Color([ 0.0 , 0.545098039216 , 0.545098039216 , 1 ]), 'DarkSlateGray1': Color([ 0.592156862745 , 1.0 , 1.0 , 1 ]), 'DarkSlateGray2': Color([ 0.552941176471 , 0.933333333333 , 0.933333333333 , 1 ]), 'DarkSlateGray3': Color([ 0.474509803922 , 0.803921568627 , 0.803921568627 , 1 ]), 'DarkSlateGray4': Color([ 0.321568627451 , 0.545098039216 , 0.545098039216 , 1 ]), 'aquamarine1': Color([ 0.498039215686 , 1.0 , 0.83137254902 , 1 ]), 'aquamarine2': Color([ 0.462745098039 , 0.933333333333 , 0.776470588235 , 1 ]), 'aquamarine3': Color([ 0.4 , 0.803921568627 , 0.666666666667 , 1 ]), 'aquamarine4': Color([ 0.270588235294 , 0.545098039216 , 0.454901960784 , 1 ]), 'DarkSeaGreen1': Color([ 0.756862745098 , 1.0 , 0.756862745098 , 1 ]), 'DarkSeaGreen2': Color([ 0.705882352941 , 0.933333333333 , 0.705882352941 , 1 ]), 'DarkSeaGreen3': Color([ 0.607843137255 , 0.803921568627 , 0.607843137255 , 1 ]), 'DarkSeaGreen4': Color([ 0.411764705882 , 0.545098039216 , 0.411764705882 , 1 ]), 'SeaGreen1': Color([ 0.329411764706 , 1.0 , 0.623529411765 , 1 ]), 'SeaGreen2': Color([ 0.305882352941 , 0.933333333333 , 0.580392156863 , 1 ]), 'SeaGreen3': Color([ 0.262745098039 , 0.803921568627 , 0.501960784314 , 1 ]), 'SeaGreen4': Color([ 0.180392156863 , 0.545098039216 , 0.341176470588 , 1 ]), 'PaleGreen1': Color([ 0.603921568627 , 1.0 , 0.603921568627 , 1 ]), 'PaleGreen2': Color([ 0.564705882353 , 0.933333333333 , 0.564705882353 , 1 ]), 'PaleGreen3': Color([ 0.486274509804 , 0.803921568627 , 0.486274509804 , 1 ]), 'PaleGreen4': Color([ 0.329411764706 , 0.545098039216 , 0.329411764706 , 1 ]), 'SpringGreen1': Color([ 0.0 , 1.0 , 0.498039215686 , 1 ]), 'SpringGreen2': Color([ 0.0 , 0.933333333333 , 0.462745098039 , 1 ]), 'SpringGreen3': Color([ 0.0 , 0.803921568627 , 0.4 , 1 ]), 'SpringGreen4': Color([ 0.0 , 0.545098039216 , 0.270588235294 , 1 ]), 'green1': Color([ 0.0 , 1.0 , 0.0 , 1 ]), 'green2': Color([ 0.0 , 0.933333333333 , 0.0 , 1 ]), 'green3': Color([ 0.0 , 0.803921568627 , 0.0 , 1 ]), 'green4': Color([ 0.0 , 0.545098039216 , 0.0 , 1 ]), 'chartreuse1': Color([ 0.498039215686 , 1.0 , 0.0 , 1 ]), 'chartreuse2': Color([ 0.462745098039 , 0.933333333333 , 0.0 , 1 ]), 'chartreuse3': Color([ 0.4 , 0.803921568627 , 0.0 , 1 ]), 'chartreuse4': Color([ 0.270588235294 , 0.545098039216 , 0.0 , 1 ]), 'OliveDrab1': Color([ 0.752941176471 , 1.0 , 0.243137254902 , 1 ]), 'OliveDrab2': Color([ 0.701960784314 , 0.933333333333 , 0.227450980392 , 1 ]), 'OliveDrab3': Color([ 0.603921568627 , 0.803921568627 , 0.196078431373 , 1 ]), 'OliveDrab4': Color([ 0.411764705882 , 0.545098039216 , 0.133333333333 , 1 ]), 'DarkOliveGreen1': Color([ 0.792156862745 , 1.0 , 0.439215686275 , 1 ]), 'DarkOliveGreen2': Color([ 0.737254901961 , 0.933333333333 , 0.407843137255 , 1 ]), 'DarkOliveGreen3': Color([ 0.635294117647 , 0.803921568627 , 0.352941176471 , 1 ]), 'DarkOliveGreen4': Color([ 0.43137254902 , 0.545098039216 , 0.239215686275 , 1 ]), 'khaki1': Color([ 1.0 , 0.964705882353 , 0.560784313725 , 1 ]), 'khaki2': Color([ 0.933333333333 , 0.901960784314 , 0.521568627451 , 1 ]), 'khaki3': Color([ 0.803921568627 , 0.776470588235 , 0.450980392157 , 1 ]), 'khaki4': Color([ 0.545098039216 , 0.525490196078 , 0.305882352941 , 1 ]), 'LightGoldenrod1': Color([ 1.0 , 0.925490196078 , 0.545098039216 , 1 ]), 'LightGoldenrod2': Color([ 0.933333333333 , 0.862745098039 , 0.509803921569 , 1 ]), 'LightGoldenrod3': Color([ 0.803921568627 , 0.745098039216 , 0.439215686275 , 1 ]), 'LightGoldenrod4': Color([ 0.545098039216 , 0.505882352941 , 0.298039215686 , 1 ]), 'LightYellow1': Color([ 1.0 , 1.0 , 0.878431372549 , 1 ]), 'LightYellow2': Color([ 0.933333333333 , 0.933333333333 , 0.819607843137 , 1 ]), 'LightYellow3': Color([ 0.803921568627 , 0.803921568627 , 0.705882352941 , 1 ]), 'LightYellow4': Color([ 0.545098039216 , 0.545098039216 , 0.478431372549 , 1 ]), 'yellow1': Color([ 1.0 , 1.0 , 0.0 , 1 ]), 'yellow2': Color([ 0.933333333333 , 0.933333333333 , 0.0 , 1 ]), 'yellow3': Color([ 0.803921568627 , 0.803921568627 , 0.0 , 1 ]), 'yellow4': Color([ 0.545098039216 , 0.545098039216 , 0.0 , 1 ]), 'gold1': Color([ 1.0 , 0.843137254902 , 0.0 , 1 ]), 'gold2': Color([ 0.933333333333 , 0.788235294118 , 0.0 , 1 ]), 'gold3': Color([ 0.803921568627 , 0.678431372549 , 0.0 , 1 ]), 'gold4': Color([ 0.545098039216 , 0.458823529412 , 0.0 , 1 ]), 'goldenrod1': Color([ 1.0 , 0.756862745098 , 0.145098039216 , 1 ]), 'goldenrod2': Color([ 0.933333333333 , 0.705882352941 , 0.133333333333 , 1 ]), 'goldenrod3': Color([ 0.803921568627 , 0.607843137255 , 0.113725490196 , 1 ]), 'goldenrod4': Color([ 0.545098039216 , 0.411764705882 , 0.078431372549 , 1 ]), 'DarkGoldenrod1': Color([ 1.0 , 0.725490196078 , 0.0588235294118 , 1 ]), 'DarkGoldenrod2': Color([ 0.933333333333 , 0.678431372549 , 0.0549019607843 , 1 ]), 'DarkGoldenrod3': Color([ 0.803921568627 , 0.58431372549 , 0.0470588235294 , 1 ]), 'DarkGoldenrod4': Color([ 0.545098039216 , 0.396078431373 , 0.0313725490196 , 1 ]), 'RosyBrown1': Color([ 1.0 , 0.756862745098 , 0.756862745098 , 1 ]), 'RosyBrown2': Color([ 0.933333333333 , 0.705882352941 , 0.705882352941 , 1 ]), 'RosyBrown3': Color([ 0.803921568627 , 0.607843137255 , 0.607843137255 , 1 ]), 'RosyBrown4': Color([ 0.545098039216 , 0.411764705882 , 0.411764705882 , 1 ]), 'IndianRed1': Color([ 1.0 , 0.41568627451 , 0.41568627451 , 1 ]), 'IndianRed2': Color([ 0.933333333333 , 0.388235294118 , 0.388235294118 , 1 ]), 'IndianRed3': Color([ 0.803921568627 , 0.333333333333 , 0.333333333333 , 1 ]), 'IndianRed4': Color([ 0.545098039216 , 0.227450980392 , 0.227450980392 , 1 ]), 'sienna1': Color([ 1.0 , 0.509803921569 , 0.278431372549 , 1 ]), 'sienna2': Color([ 0.933333333333 , 0.474509803922 , 0.258823529412 , 1 ]), 'sienna3': Color([ 0.803921568627 , 0.407843137255 , 0.223529411765 , 1 ]), 'sienna4': Color([ 0.545098039216 , 0.278431372549 , 0.149019607843 , 1 ]), 'burlywood1': Color([ 1.0 , 0.827450980392 , 0.607843137255 , 1 ]), 'burlywood2': Color([ 0.933333333333 , 0.772549019608 , 0.56862745098 , 1 ]), 'burlywood3': Color([ 0.803921568627 , 0.666666666667 , 0.490196078431 , 1 ]), 'burlywood4': Color([ 0.545098039216 , 0.450980392157 , 0.333333333333 , 1 ]), 'wheat1': Color([ 1.0 , 0.905882352941 , 0.729411764706 , 1 ]), 'wheat2': Color([ 0.933333333333 , 0.847058823529 , 0.682352941176 , 1 ]), 'wheat3': Color([ 0.803921568627 , 0.729411764706 , 0.588235294118 , 1 ]), 'wheat4': Color([ 0.545098039216 , 0.494117647059 , 0.4 , 1 ]), 'tan1': Color([ 1.0 , 0.647058823529 , 0.309803921569 , 1 ]), 'tan2': Color([ 0.933333333333 , 0.603921568627 , 0.286274509804 , 1 ]), 'tan3': Color([ 0.803921568627 , 0.521568627451 , 0.247058823529 , 1 ]), 'tan4': Color([ 0.545098039216 , 0.352941176471 , 0.16862745098 , 1 ]), 'chocolate1': Color([ 1.0 , 0.498039215686 , 0.141176470588 , 1 ]), 'chocolate2': Color([ 0.933333333333 , 0.462745098039 , 0.129411764706 , 1 ]), 'chocolate3': Color([ 0.803921568627 , 0.4 , 0.113725490196 , 1 ]), 'chocolate4': Color([ 0.545098039216 , 0.270588235294 , 0.0745098039216 , 1 ]), 'firebrick1': Color([ 1.0 , 0.188235294118 , 0.188235294118 , 1 ]), 'firebrick2': Color([ 0.933333333333 , 0.172549019608 , 0.172549019608 , 1 ]), 'firebrick3': Color([ 0.803921568627 , 0.149019607843 , 0.149019607843 , 1 ]), 'firebrick4': Color([ 0.545098039216 , 0.101960784314 , 0.101960784314 , 1 ]), 'brown1': Color([ 1.0 , 0.250980392157 , 0.250980392157 , 1 ]), 'brown2': Color([ 0.933333333333 , 0.23137254902 , 0.23137254902 , 1 ]), 'brown3': Color([ 0.803921568627 , 0.2 , 0.2 , 1 ]), 'brown4': Color([ 0.545098039216 , 0.137254901961 , 0.137254901961 , 1 ]), 'salmon1': Color([ 1.0 , 0.549019607843 , 0.411764705882 , 1 ]), 'salmon2': Color([ 0.933333333333 , 0.509803921569 , 0.38431372549 , 1 ]), 'salmon3': Color([ 0.803921568627 , 0.439215686275 , 0.329411764706 , 1 ]), 'salmon4': Color([ 0.545098039216 , 0.298039215686 , 0.223529411765 , 1 ]), 'LightSalmon1': Color([ 1.0 , 0.627450980392 , 0.478431372549 , 1 ]), 'LightSalmon2': Color([ 0.933333333333 , 0.58431372549 , 0.447058823529 , 1 ]), 'LightSalmon3': Color([ 0.803921568627 , 0.505882352941 , 0.38431372549 , 1 ]), 'LightSalmon4': Color([ 0.545098039216 , 0.341176470588 , 0.258823529412 , 1 ]), 'orange1': Color([ 1.0 , 0.647058823529 , 0.0 , 1 ]), 'orange2': Color([ 0.933333333333 , 0.603921568627 , 0.0 , 1 ]), 'orange3': Color([ 0.803921568627 , 0.521568627451 , 0.0 , 1 ]), 'orange4': Color([ 0.545098039216 , 0.352941176471 , 0.0 , 1 ]), 'DarkOrange1': Color([ 1.0 , 0.498039215686 , 0.0 , 1 ]), 'DarkOrange2': Color([ 0.933333333333 , 0.462745098039 , 0.0 , 1 ]), 'DarkOrange3': Color([ 0.803921568627 , 0.4 , 0.0 , 1 ]), 'DarkOrange4': Color([ 0.545098039216 , 0.270588235294 , 0.0 , 1 ]), 'coral1': Color([ 1.0 , 0.447058823529 , 0.337254901961 , 1 ]), 'coral2': Color([ 0.933333333333 , 0.41568627451 , 0.313725490196 , 1 ]), 'coral3': Color([ 0.803921568627 , 0.356862745098 , 0.270588235294 , 1 ]), 'coral4': Color([ 0.545098039216 , 0.243137254902 , 0.18431372549 , 1 ]), 'tomato1': Color([ 1.0 , 0.388235294118 , 0.278431372549 , 1 ]), 'tomato2': Color([ 0.933333333333 , 0.360784313725 , 0.258823529412 , 1 ]), 'tomato3': Color([ 0.803921568627 , 0.309803921569 , 0.223529411765 , 1 ]), 'tomato4': Color([ 0.545098039216 , 0.211764705882 , 0.149019607843 , 1 ]), 'OrangeRed1': Color([ 1.0 , 0.270588235294 , 0.0 , 1 ]), 'OrangeRed2': Color([ 0.933333333333 , 0.250980392157 , 0.0 , 1 ]), 'OrangeRed3': Color([ 0.803921568627 , 0.21568627451 , 0.0 , 1 ]), 'OrangeRed4': Color([ 0.545098039216 , 0.145098039216 , 0.0 , 1 ]), 'red1': Color([ 1.0 , 0.0 , 0.0 , 1 ]), 'red2': Color([ 0.933333333333 , 0.0 , 0.0 , 1 ]), 'red3': Color([ 0.803921568627 , 0.0 , 0.0 , 1 ]), 'red4': Color([ 0.545098039216 , 0.0 , 0.0 , 1 ]), 'DeepPink1': Color([ 1.0 , 0.078431372549 , 0.576470588235 , 1 ]), 'DeepPink2': Color([ 0.933333333333 , 0.0705882352941 , 0.537254901961 , 1 ]), 'DeepPink3': Color([ 0.803921568627 , 0.0627450980392 , 0.462745098039 , 1 ]), 'DeepPink4': Color([ 0.545098039216 , 0.0392156862745 , 0.313725490196 , 1 ]), 'HotPink1': Color([ 1.0 , 0.43137254902 , 0.705882352941 , 1 ]), 'HotPink2': Color([ 0.933333333333 , 0.41568627451 , 0.654901960784 , 1 ]), 'HotPink3': Color([ 0.803921568627 , 0.376470588235 , 0.564705882353 , 1 ]), 'HotPink4': Color([ 0.545098039216 , 0.227450980392 , 0.38431372549 , 1 ]), 'pink1': Color([ 1.0 , 0.709803921569 , 0.772549019608 , 1 ]), 'pink2': Color([ 0.933333333333 , 0.662745098039 , 0.721568627451 , 1 ]), 'pink3': Color([ 0.803921568627 , 0.56862745098 , 0.619607843137 , 1 ]), 'pink4': Color([ 0.545098039216 , 0.388235294118 , 0.423529411765 , 1 ]), 'LightPink1': Color([ 1.0 , 0.682352941176 , 0.725490196078 , 1 ]), 'LightPink2': Color([ 0.933333333333 , 0.635294117647 , 0.678431372549 , 1 ]), 'LightPink3': Color([ 0.803921568627 , 0.549019607843 , 0.58431372549 , 1 ]), 'LightPink4': Color([ 0.545098039216 , 0.372549019608 , 0.396078431373 , 1 ]), 'PaleVioletRed1': Color([ 1.0 , 0.509803921569 , 0.670588235294 , 1 ]), 'PaleVioletRed2': Color([ 0.933333333333 , 0.474509803922 , 0.623529411765 , 1 ]), 'PaleVioletRed3': Color([ 0.803921568627 , 0.407843137255 , 0.537254901961 , 1 ]), 'PaleVioletRed4': Color([ 0.545098039216 , 0.278431372549 , 0.364705882353 , 1 ]), 'maroon1': Color([ 1.0 , 0.203921568627 , 0.701960784314 , 1 ]), 'maroon2': Color([ 0.933333333333 , 0.188235294118 , 0.654901960784 , 1 ]), 'maroon3': Color([ 0.803921568627 , 0.160784313725 , 0.564705882353 , 1 ]), 'maroon4': Color([ 0.545098039216 , 0.109803921569 , 0.38431372549 , 1 ]), 'VioletRed1': Color([ 1.0 , 0.243137254902 , 0.588235294118 , 1 ]), 'VioletRed2': Color([ 0.933333333333 , 0.227450980392 , 0.549019607843 , 1 ]), 'VioletRed3': Color([ 0.803921568627 , 0.196078431373 , 0.470588235294 , 1 ]), 'VioletRed4': Color([ 0.545098039216 , 0.133333333333 , 0.321568627451 , 1 ]), 'magenta1': Color([ 1.0 , 0.0 , 1.0 , 1 ]), 'magenta2': Color([ 0.933333333333 , 0.0 , 0.933333333333 , 1 ]), 'magenta3': Color([ 0.803921568627 , 0.0 , 0.803921568627 , 1 ]), 'magenta4': Color([ 0.545098039216 , 0.0 , 0.545098039216 , 1 ]), 'orchid1': Color([ 1.0 , 0.513725490196 , 0.980392156863 , 1 ]), 'orchid2': Color([ 0.933333333333 , 0.478431372549 , 0.913725490196 , 1 ]), 'orchid3': Color([ 0.803921568627 , 0.411764705882 , 0.788235294118 , 1 ]), 'orchid4': Color([ 0.545098039216 , 0.278431372549 , 0.537254901961 , 1 ]), 'plum1': Color([ 1.0 , 0.733333333333 , 1.0 , 1 ]), 'plum2': Color([ 0.933333333333 , 0.682352941176 , 0.933333333333 , 1 ]), 'plum3': Color([ 0.803921568627 , 0.588235294118 , 0.803921568627 , 1 ]), 'plum4': Color([ 0.545098039216 , 0.4 , 0.545098039216 , 1 ]), 'MediumOrchid1': Color([ 0.878431372549 , 0.4 , 1.0 , 1 ]), 'MediumOrchid2': Color([ 0.819607843137 , 0.372549019608 , 0.933333333333 , 1 ]), 'MediumOrchid3': Color([ 0.705882352941 , 0.321568627451 , 0.803921568627 , 1 ]), 'MediumOrchid4': Color([ 0.478431372549 , 0.21568627451 , 0.545098039216 , 1 ]), 'DarkOrchid1': Color([ 0.749019607843 , 0.243137254902 , 1.0 , 1 ]), 'DarkOrchid2': Color([ 0.698039215686 , 0.227450980392 , 0.933333333333 , 1 ]), 'DarkOrchid3': Color([ 0.603921568627 , 0.196078431373 , 0.803921568627 , 1 ]), 'DarkOrchid4': Color([ 0.407843137255 , 0.133333333333 , 0.545098039216 , 1 ]), 'purple1': Color([ 0.607843137255 , 0.188235294118 , 1.0 , 1 ]), 'purple2': Color([ 0.56862745098 , 0.172549019608 , 0.933333333333 , 1 ]), 'purple3': Color([ 0.490196078431 , 0.149019607843 , 0.803921568627 , 1 ]), 'purple4': Color([ 0.333333333333 , 0.101960784314 , 0.545098039216 , 1 ]), 'MediumPurple1': Color([ 0.670588235294 , 0.509803921569 , 1.0 , 1 ]), 'MediumPurple2': Color([ 0.623529411765 , 0.474509803922 , 0.933333333333 , 1 ]), 'MediumPurple3': Color([ 0.537254901961 , 0.407843137255 , 0.803921568627 , 1 ]), 'MediumPurple4': Color([ 0.364705882353 , 0.278431372549 , 0.545098039216 , 1 ]), 'thistle1': Color([ 1.0 , 0.882352941176 , 1.0 , 1 ]), 'thistle2': Color([ 0.933333333333 , 0.823529411765 , 0.933333333333 , 1 ]), 'thistle3': Color([ 0.803921568627 , 0.709803921569 , 0.803921568627 , 1 ]), 'thistle4': Color([ 0.545098039216 , 0.482352941176 , 0.545098039216 , 1 ]), 'gray0': Color([ 0.0 , 0.0 , 0.0 , 1 ]), 'grey0': Color([ 0.0 , 0.0 , 0.0 , 1 ]), 'gray1': Color([ 0.0117647058824 , 0.0117647058824 , 0.0117647058824 , 1 ]), 'grey1': Color([ 0.0117647058824 , 0.0117647058824 , 0.0117647058824 , 1 ]), 'gray2': Color([ 0.0196078431373 , 0.0196078431373 , 0.0196078431373 , 1 ]), 'grey2': Color([ 0.0196078431373 , 0.0196078431373 , 0.0196078431373 , 1 ]), 'gray3': Color([ 0.0313725490196 , 0.0313725490196 , 0.0313725490196 , 1 ]), 'grey3': Color([ 0.0313725490196 , 0.0313725490196 , 0.0313725490196 , 1 ]), 'gray4': Color([ 0.0392156862745 , 0.0392156862745 , 0.0392156862745 , 1 ]), 'grey4': Color([ 0.0392156862745 , 0.0392156862745 , 0.0392156862745 , 1 ]), 'gray5': Color([ 0.0509803921569 , 0.0509803921569 , 0.0509803921569 , 1 ]), 'grey5': Color([ 0.0509803921569 , 0.0509803921569 , 0.0509803921569 , 1 ]), 'gray6': Color([ 0.0588235294118 , 0.0588235294118 , 0.0588235294118 , 1 ]), 'grey6': Color([ 0.0588235294118 , 0.0588235294118 , 0.0588235294118 , 1 ]), 'gray7': Color([ 0.0705882352941 , 0.0705882352941 , 0.0705882352941 , 1 ]), 'grey7': Color([ 0.0705882352941 , 0.0705882352941 , 0.0705882352941 , 1 ]), 'gray8': Color([ 0.078431372549 , 0.078431372549 , 0.078431372549 , 1 ]), 'grey8': Color([ 0.078431372549 , 0.078431372549 , 0.078431372549 , 1 ]), 'gray9': Color([ 0.0901960784314 , 0.0901960784314 , 0.0901960784314 , 1 ]), 'grey9': Color([ 0.0901960784314 , 0.0901960784314 , 0.0901960784314 , 1 ]), 'gray10': Color([ 0.101960784314 , 0.101960784314 , 0.101960784314 , 1 ]), 'grey10': Color([ 0.101960784314 , 0.101960784314 , 0.101960784314 , 1 ]), 'gray11': Color([ 0.109803921569 , 0.109803921569 , 0.109803921569 , 1 ]), 'grey11': Color([ 0.109803921569 , 0.109803921569 , 0.109803921569 , 1 ]), 'gray12': Color([ 0.121568627451 , 0.121568627451 , 0.121568627451 , 1 ]), 'grey12': Color([ 0.121568627451 , 0.121568627451 , 0.121568627451 , 1 ]), 'gray13': Color([ 0.129411764706 , 0.129411764706 , 0.129411764706 , 1 ]), 'grey13': Color([ 0.129411764706 , 0.129411764706 , 0.129411764706 , 1 ]), 'gray14': Color([ 0.141176470588 , 0.141176470588 , 0.141176470588 , 1 ]), 'grey14': Color([ 0.141176470588 , 0.141176470588 , 0.141176470588 , 1 ]), 'gray15': Color([ 0.149019607843 , 0.149019607843 , 0.149019607843 , 1 ]), 'grey15': Color([ 0.149019607843 , 0.149019607843 , 0.149019607843 , 1 ]), 'gray16': Color([ 0.160784313725 , 0.160784313725 , 0.160784313725 , 1 ]), 'grey16': Color([ 0.160784313725 , 0.160784313725 , 0.160784313725 , 1 ]), 'gray17': Color([ 0.16862745098 , 0.16862745098 , 0.16862745098 , 1 ]), 'grey17': Color([ 0.16862745098 , 0.16862745098 , 0.16862745098 , 1 ]), 'gray18': Color([ 0.180392156863 , 0.180392156863 , 0.180392156863 , 1 ]), 'grey18': Color([ 0.180392156863 , 0.180392156863 , 0.180392156863 , 1 ]), 'gray19': Color([ 0.188235294118 , 0.188235294118 , 0.188235294118 , 1 ]), 'grey19': Color([ 0.188235294118 , 0.188235294118 , 0.188235294118 , 1 ]), 'gray20': Color([ 0.2 , 0.2 , 0.2 , 1 ]), 'grey20': Color([ 0.2 , 0.2 , 0.2 , 1 ]), 'gray21': Color([ 0.211764705882 , 0.211764705882 , 0.211764705882 , 1 ]), 'grey21': Color([ 0.211764705882 , 0.211764705882 , 0.211764705882 , 1 ]), 'gray22': Color([ 0.219607843137 , 0.219607843137 , 0.219607843137 , 1 ]), 'grey22': Color([ 0.219607843137 , 0.219607843137 , 0.219607843137 , 1 ]), 'gray23': Color([ 0.23137254902 , 0.23137254902 , 0.23137254902 , 1 ]), 'grey23': Color([ 0.23137254902 , 0.23137254902 , 0.23137254902 , 1 ]), 'gray24': Color([ 0.239215686275 , 0.239215686275 , 0.239215686275 , 1 ]), 'grey24': Color([ 0.239215686275 , 0.239215686275 , 0.239215686275 , 1 ]), 'gray25': Color([ 0.250980392157 , 0.250980392157 , 0.250980392157 , 1 ]), 'grey25': Color([ 0.250980392157 , 0.250980392157 , 0.250980392157 , 1 ]), 'gray26': Color([ 0.258823529412 , 0.258823529412 , 0.258823529412 , 1 ]), 'grey26': Color([ 0.258823529412 , 0.258823529412 , 0.258823529412 , 1 ]), 'gray27': Color([ 0.270588235294 , 0.270588235294 , 0.270588235294 , 1 ]), 'grey27': Color([ 0.270588235294 , 0.270588235294 , 0.270588235294 , 1 ]), 'gray28': Color([ 0.278431372549 , 0.278431372549 , 0.278431372549 , 1 ]), 'grey28': Color([ 0.278431372549 , 0.278431372549 , 0.278431372549 , 1 ]), 'gray29': Color([ 0.290196078431 , 0.290196078431 , 0.290196078431 , 1 ]), 'grey29': Color([ 0.290196078431 , 0.290196078431 , 0.290196078431 , 1 ]), 'gray30': Color([ 0.301960784314 , 0.301960784314 , 0.301960784314 , 1 ]), 'grey30': Color([ 0.301960784314 , 0.301960784314 , 0.301960784314 , 1 ]), 'gray31': Color([ 0.309803921569 , 0.309803921569 , 0.309803921569 , 1 ]), 'grey31': Color([ 0.309803921569 , 0.309803921569 , 0.309803921569 , 1 ]), 'gray32': Color([ 0.321568627451 , 0.321568627451 , 0.321568627451 , 1 ]), 'grey32': Color([ 0.321568627451 , 0.321568627451 , 0.321568627451 , 1 ]), 'gray33': Color([ 0.329411764706 , 0.329411764706 , 0.329411764706 , 1 ]), 'grey33': Color([ 0.329411764706 , 0.329411764706 , 0.329411764706 , 1 ]), 'gray34': Color([ 0.341176470588 , 0.341176470588 , 0.341176470588 , 1 ]), 'grey34': Color([ 0.341176470588 , 0.341176470588 , 0.341176470588 , 1 ]), 'gray35': Color([ 0.349019607843 , 0.349019607843 , 0.349019607843 , 1 ]), 'grey35': Color([ 0.349019607843 , 0.349019607843 , 0.349019607843 , 1 ]), 'gray36': Color([ 0.360784313725 , 0.360784313725 , 0.360784313725 , 1 ]), 'grey36': Color([ 0.360784313725 , 0.360784313725 , 0.360784313725 , 1 ]), 'gray37': Color([ 0.36862745098 , 0.36862745098 , 0.36862745098 , 1 ]), 'grey37': Color([ 0.36862745098 , 0.36862745098 , 0.36862745098 , 1 ]), 'gray38': Color([ 0.380392156863 , 0.380392156863 , 0.380392156863 , 1 ]), 'grey38': Color([ 0.380392156863 , 0.380392156863 , 0.380392156863 , 1 ]), 'gray39': Color([ 0.388235294118 , 0.388235294118 , 0.388235294118 , 1 ]), 'grey39': Color([ 0.388235294118 , 0.388235294118 , 0.388235294118 , 1 ]), 'gray40': Color([ 0.4 , 0.4 , 0.4 , 1 ]), 'grey40': Color([ 0.4 , 0.4 , 0.4 , 1 ]), 'gray41': Color([ 0.411764705882 , 0.411764705882 , 0.411764705882 , 1 ]), 'grey41': Color([ 0.411764705882 , 0.411764705882 , 0.411764705882 , 1 ]), 'gray42': Color([ 0.419607843137 , 0.419607843137 , 0.419607843137 , 1 ]), 'grey42': Color([ 0.419607843137 , 0.419607843137 , 0.419607843137 , 1 ]), 'gray43': Color([ 0.43137254902 , 0.43137254902 , 0.43137254902 , 1 ]), 'grey43': Color([ 0.43137254902 , 0.43137254902 , 0.43137254902 , 1 ]), 'gray44': Color([ 0.439215686275 , 0.439215686275 , 0.439215686275 , 1 ]), 'grey44': Color([ 0.439215686275 , 0.439215686275 , 0.439215686275 , 1 ]), 'gray45': Color([ 0.450980392157 , 0.450980392157 , 0.450980392157 , 1 ]), 'grey45': Color([ 0.450980392157 , 0.450980392157 , 0.450980392157 , 1 ]), 'gray46': Color([ 0.458823529412 , 0.458823529412 , 0.458823529412 , 1 ]), 'grey46': Color([ 0.458823529412 , 0.458823529412 , 0.458823529412 , 1 ]), 'gray47': Color([ 0.470588235294 , 0.470588235294 , 0.470588235294 , 1 ]), 'grey47': Color([ 0.470588235294 , 0.470588235294 , 0.470588235294 , 1 ]), 'gray48': Color([ 0.478431372549 , 0.478431372549 , 0.478431372549 , 1 ]), 'grey48': Color([ 0.478431372549 , 0.478431372549 , 0.478431372549 , 1 ]), 'gray49': Color([ 0.490196078431 , 0.490196078431 , 0.490196078431 , 1 ]), 'grey49': Color([ 0.490196078431 , 0.490196078431 , 0.490196078431 , 1 ]), 'gray50': Color([ 0.498039215686 , 0.498039215686 , 0.498039215686 , 1 ]), 'grey50': Color([ 0.498039215686 , 0.498039215686 , 0.498039215686 , 1 ]), 'gray51': Color([ 0.509803921569 , 0.509803921569 , 0.509803921569 , 1 ]), 'grey51': Color([ 0.509803921569 , 0.509803921569 , 0.509803921569 , 1 ]), 'gray52': Color([ 0.521568627451 , 0.521568627451 , 0.521568627451 , 1 ]), 'grey52': Color([ 0.521568627451 , 0.521568627451 , 0.521568627451 , 1 ]), 'gray53': Color([ 0.529411764706 , 0.529411764706 , 0.529411764706 , 1 ]), 'grey53': Color([ 0.529411764706 , 0.529411764706 , 0.529411764706 , 1 ]), 'gray54': Color([ 0.541176470588 , 0.541176470588 , 0.541176470588 , 1 ]), 'grey54': Color([ 0.541176470588 , 0.541176470588 , 0.541176470588 , 1 ]), 'gray55': Color([ 0.549019607843 , 0.549019607843 , 0.549019607843 , 1 ]), 'grey55': Color([ 0.549019607843 , 0.549019607843 , 0.549019607843 , 1 ]), 'gray56': Color([ 0.560784313725 , 0.560784313725 , 0.560784313725 , 1 ]), 'grey56': Color([ 0.560784313725 , 0.560784313725 , 0.560784313725 , 1 ]), 'gray57': Color([ 0.56862745098 , 0.56862745098 , 0.56862745098 , 1 ]), 'grey57': Color([ 0.56862745098 , 0.56862745098 , 0.56862745098 , 1 ]), 'gray58': Color([ 0.580392156863 , 0.580392156863 , 0.580392156863 , 1 ]), 'grey58': Color([ 0.580392156863 , 0.580392156863 , 0.580392156863 , 1 ]), 'gray59': Color([ 0.588235294118 , 0.588235294118 , 0.588235294118 , 1 ]), 'grey59': Color([ 0.588235294118 , 0.588235294118 , 0.588235294118 , 1 ]), 'gray60': Color([ 0.6 , 0.6 , 0.6 , 1 ]), 'grey60': Color([ 0.6 , 0.6 , 0.6 , 1 ]), 'gray61': Color([ 0.611764705882 , 0.611764705882 , 0.611764705882 , 1 ]), 'grey61': Color([ 0.611764705882 , 0.611764705882 , 0.611764705882 , 1 ]), 'gray62': Color([ 0.619607843137 , 0.619607843137 , 0.619607843137 , 1 ]), 'grey62': Color([ 0.619607843137 , 0.619607843137 , 0.619607843137 , 1 ]), 'gray63': Color([ 0.63137254902 , 0.63137254902 , 0.63137254902 , 1 ]), 'grey63': Color([ 0.63137254902 , 0.63137254902 , 0.63137254902 , 1 ]), 'gray64': Color([ 0.639215686275 , 0.639215686275 , 0.639215686275 , 1 ]), 'grey64': Color([ 0.639215686275 , 0.639215686275 , 0.639215686275 , 1 ]), 'gray65': Color([ 0.650980392157 , 0.650980392157 , 0.650980392157 , 1 ]), 'grey65': Color([ 0.650980392157 , 0.650980392157 , 0.650980392157 , 1 ]), 'gray66': Color([ 0.658823529412 , 0.658823529412 , 0.658823529412 , 1 ]), 'grey66': Color([ 0.658823529412 , 0.658823529412 , 0.658823529412 , 1 ]), 'gray67': Color([ 0.670588235294 , 0.670588235294 , 0.670588235294 , 1 ]), 'grey67': Color([ 0.670588235294 , 0.670588235294 , 0.670588235294 , 1 ]), 'gray68': Color([ 0.678431372549 , 0.678431372549 , 0.678431372549 , 1 ]), 'grey68': Color([ 0.678431372549 , 0.678431372549 , 0.678431372549 , 1 ]), 'gray69': Color([ 0.690196078431 , 0.690196078431 , 0.690196078431 , 1 ]), 'grey69': Color([ 0.690196078431 , 0.690196078431 , 0.690196078431 , 1 ]), 'gray70': Color([ 0.701960784314 , 0.701960784314 , 0.701960784314 , 1 ]), 'grey70': Color([ 0.701960784314 , 0.701960784314 , 0.701960784314 , 1 ]), 'gray71': Color([ 0.709803921569 , 0.709803921569 , 0.709803921569 , 1 ]), 'grey71': Color([ 0.709803921569 , 0.709803921569 , 0.709803921569 , 1 ]), 'gray72': Color([ 0.721568627451 , 0.721568627451 , 0.721568627451 , 1 ]), 'grey72': Color([ 0.721568627451 , 0.721568627451 , 0.721568627451 , 1 ]), 'gray73': Color([ 0.729411764706 , 0.729411764706 , 0.729411764706 , 1 ]), 'grey73': Color([ 0.729411764706 , 0.729411764706 , 0.729411764706 , 1 ]), 'gray74': Color([ 0.741176470588 , 0.741176470588 , 0.741176470588 , 1 ]), 'grey74': Color([ 0.741176470588 , 0.741176470588 , 0.741176470588 , 1 ]), 'gray75': Color([ 0.749019607843 , 0.749019607843 , 0.749019607843 , 1 ]), 'grey75': Color([ 0.749019607843 , 0.749019607843 , 0.749019607843 , 1 ]), 'gray76': Color([ 0.760784313725 , 0.760784313725 , 0.760784313725 , 1 ]), 'grey76': Color([ 0.760784313725 , 0.760784313725 , 0.760784313725 , 1 ]), 'gray77': Color([ 0.76862745098 , 0.76862745098 , 0.76862745098 , 1 ]), 'grey77': Color([ 0.76862745098 , 0.76862745098 , 0.76862745098 , 1 ]), 'gray78': Color([ 0.780392156863 , 0.780392156863 , 0.780392156863 , 1 ]), 'grey78': Color([ 0.780392156863 , 0.780392156863 , 0.780392156863 , 1 ]), 'gray79': Color([ 0.788235294118 , 0.788235294118 , 0.788235294118 , 1 ]), 'grey79': Color([ 0.788235294118 , 0.788235294118 , 0.788235294118 , 1 ]), 'gray80': Color([ 0.8 , 0.8 , 0.8 , 1 ]), 'grey80': Color([ 0.8 , 0.8 , 0.8 , 1 ]), 'gray81': Color([ 0.811764705882 , 0.811764705882 , 0.811764705882 , 1 ]), 'grey81': Color([ 0.811764705882 , 0.811764705882 , 0.811764705882 , 1 ]), 'gray82': Color([ 0.819607843137 , 0.819607843137 , 0.819607843137 , 1 ]), 'grey82': Color([ 0.819607843137 , 0.819607843137 , 0.819607843137 , 1 ]), 'gray83': Color([ 0.83137254902 , 0.83137254902 , 0.83137254902 , 1 ]), 'grey83': Color([ 0.83137254902 , 0.83137254902 , 0.83137254902 , 1 ]), 'gray84': Color([ 0.839215686275 , 0.839215686275 , 0.839215686275 , 1 ]), 'grey84': Color([ 0.839215686275 , 0.839215686275 , 0.839215686275 , 1 ]), 'gray85': Color([ 0.850980392157 , 0.850980392157 , 0.850980392157 , 1 ]), 'grey85': Color([ 0.850980392157 , 0.850980392157 , 0.850980392157 , 1 ]), 'gray86': Color([ 0.858823529412 , 0.858823529412 , 0.858823529412 , 1 ]), 'grey86': Color([ 0.858823529412 , 0.858823529412 , 0.858823529412 , 1 ]), 'gray87': Color([ 0.870588235294 , 0.870588235294 , 0.870588235294 , 1 ]), 'grey87': Color([ 0.870588235294 , 0.870588235294 , 0.870588235294 , 1 ]), 'gray88': Color([ 0.878431372549 , 0.878431372549 , 0.878431372549 , 1 ]), 'grey88': Color([ 0.878431372549 , 0.878431372549 , 0.878431372549 , 1 ]), 'gray89': Color([ 0.890196078431 , 0.890196078431 , 0.890196078431 , 1 ]), 'grey89': Color([ 0.890196078431 , 0.890196078431 , 0.890196078431 , 1 ]), 'gray90': Color([ 0.898039215686 , 0.898039215686 , 0.898039215686 , 1 ]), 'grey90': Color([ 0.898039215686 , 0.898039215686 , 0.898039215686 , 1 ]), 'gray91': Color([ 0.909803921569 , 0.909803921569 , 0.909803921569 , 1 ]), 'grey91': Color([ 0.909803921569 , 0.909803921569 , 0.909803921569 , 1 ]), 'gray92': Color([ 0.921568627451 , 0.921568627451 , 0.921568627451 , 1 ]), 'grey92': Color([ 0.921568627451 , 0.921568627451 , 0.921568627451 , 1 ]), 'gray93': Color([ 0.929411764706 , 0.929411764706 , 0.929411764706 , 1 ]), 'grey93': Color([ 0.929411764706 , 0.929411764706 , 0.929411764706 , 1 ]), 'gray94': Color([ 0.941176470588 , 0.941176470588 , 0.941176470588 , 1 ]), 'grey94': Color([ 0.941176470588 , 0.941176470588 , 0.941176470588 , 1 ]), 'gray95': Color([ 0.949019607843 , 0.949019607843 , 0.949019607843 , 1 ]), 'grey95': Color([ 0.949019607843 , 0.949019607843 , 0.949019607843 , 1 ]), 'gray96': Color([ 0.960784313725 , 0.960784313725 , 0.960784313725 , 1 ]), 'grey96': Color([ 0.960784313725 , 0.960784313725 , 0.960784313725 , 1 ]), 'gray97': Color([ 0.96862745098 , 0.96862745098 , 0.96862745098 , 1 ]), 'grey97': Color([ 0.96862745098 , 0.96862745098 , 0.96862745098 , 1 ]), 'gray98': Color([ 0.980392156863 , 0.980392156863 , 0.980392156863 , 1 ]), 'grey98': Color([ 0.980392156863 , 0.980392156863 , 0.980392156863 , 1 ]), 'gray99': Color([ 0.988235294118 , 0.988235294118 , 0.988235294118 , 1 ]), 'grey99': Color([ 0.988235294118 , 0.988235294118 , 0.988235294118 , 1 ]), 'gray100': Color([ 1.0 , 1.0 , 1.0 , 1 ]), 'grey100': Color([ 1.0 , 1.0 , 1.0 , 1 ]), 'DarkGrey': Color([ 0.662745098039 , 0.662745098039 , 0.662745098039 , 1 ]), 'DarkGray': Color([ 0.662745098039 , 0.662745098039 , 0.662745098039 , 1 ]), 'DarkBlue': Color([ 0.0 , 0.0 , 0.545098039216 , 1 ]), 'DarkCyan': Color([ 0.0 , 0.545098039216 , 0.545098039216 , 1 ]), 'DarkMagenta': Color([ 0.545098039216 , 0.0 , 0.545098039216 , 1 ]), 'DarkRed': Color([ 0.545098039216 , 0.0 , 0.0 , 1 ]), 'LightGreen': Color([ 0.564705882353 , 0.933333333333 , 0.564705882353 , 1 ]), } class Light: nextLightNum = 0 def __init__(self): if Light.nextLightNum < GL_MAX_LIGHTS: self.lightNumber = GL_LIGHT0 + Light.nextLightNum Light.nextLightNum += 1 else: print "Warning: Maximum number of lights (", GL_MAX_LIGHTS, ") exceeded" self.lightNumber = GL_LIGHT0 + GL_MAX_LIGHTS - 1 self.ambient = [0, 0, 0, 1] self.diffuse = [1, 1, 1, 1] self.specular = [1, 1, 1, 1] self.position = [0, 0, 1, 0] self.attenuation = [1, 0, 0] self.spotDirection = [0, 0, -1] self.spotCutoff = 180 self.spotExponent = 0 def apply(self): glEnable(self.lightNumber) glLightfv(self.lightNumber, GL_POSITION, self.position) glLightfv(self.lightNumber, GL_AMBIENT, self.ambient) glLightfv(self.lightNumber, GL_DIFFUSE, self.diffuse) glLightfv(self.lightNumber, GL_SPECULAR, self.specular) glLightf(self.lightNumber, GL_CONSTANT_ATTENUATION, self.attenuation[0]) glLightf(self.lightNumber, GL_LINEAR_ATTENUATION, self.attenuation[1]) glLightf(self.lightNumber, GL_QUADRATIC_ATTENUATION, self.attenuation[2]) glLightf(self.lightNumber, GL_SPOT_CUTOFF, self.spotCutoff) if self.spotCutoff < 180: glLightfv(self.lightNumber, GL_SPOT_DIRECTION, self.spotDirection.vec) glLightf(self.lightNumber, GL_SPOT_EXPONENT, self.spotExponent) def enable(self): glEnable(self.lightNumber) def disable(self): glDisable(self.lightNumber) class Material: def __init__(self, face=GL_FRONT_AND_BACK, diffuse=[0.8, 0.8, 0.8, 1], ambient=[0.2, 0.2, 0.2, 1], specular=[0, 0, 0, 1], shininess=0, emission=[0, 0, 0, 0]): self.face = face self.diffuse = diffuse self.ambient = ambient self.specular = specular self.shininess = shininess self.emission = emission def apply(self): glEnable(GL_LIGHTING) glMaterialfv(self.face, GL_AMBIENT, self.ambient) glMaterialfv(self.face, GL_DIFFUSE, self.diffuse) glMaterialfv(self.face, GL_SPECULAR, self.specular) glMaterialf(self.face, GL_SHININESS, self.shininess) glMaterialfv(self.face, GL_EMISSION, self.emission) def disable(self): glDisable(GL_LIGHTING) import Image class Texture2D: def __init__(self, file, wrap=GL_REPEAT, minFilter=GL_LINEAR, magFilter=GL_LINEAR, texenv=GL_MODULATE): self.file = file self.wrapS = wrap self.wrapT = wrap self.minFilter = minFilter self.magFilter = magFilter self.texenv = texenv self.defined = False self.id = 0 def define(self): img = Image.open(self.file).transpose(Image.FLIP_TOP_BOTTOM).convert('RGBA') width = 2 while width < img.size[0]: width *= 2 width /= 2 height = 2 while height < img.size[1]: height *= 2 height /= 2 if (width != img.size[0]) or (height != img.size[1]): img = img.resize((width,height)) self.id = glGenTextures(1) glBindTexture(GL_TEXTURE_2D, self.id) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, self.wrapS) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, self.wrapT) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, self.minFilter) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, self.magFilter) if (self.minFilter == GL_NEAREST_MIPMAP_NEAREST) or \ (self.minFilter == GL_NEAREST_MIPMAP_LINEAR) or \ (self.minFilter == GL_LINEAR_MIPMAP_NEAREST) or \ (self.minFilter == GL_LINEAR_MIPMAP_LINEAR): gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, img.size[0], img.size[1], GL_RGBA, GL_UNSIGNED_BYTE, img.tostring()) else: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img.size[0], img.size[1], 0, GL_RGBA, GL_UNSIGNED_BYTE, img.tostring()) glBindTexture(GL_TEXTURE_2D, 0) self.defined = True def apply(self): if not self.defined: self.define() glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, self.texenv) glBindTexture(GL_TEXTURE_2D, self.id) if self.id != 0: glEnable(GL_TEXTURE_2D) else: glDisable(GL_TEXTURE_2D) def disable(self): glBindTexture(GL_TEXTURE_2D, 0) glDisable(GL_TEXTURE_2D) class Texture1D: def __init__(self, file, wrap=GL_REPEAT, minFilter=GL_LINEAR, magFilter=GL_LINEAR): self.file = file self.wrapS = wrap self.minFilter = minFilter self.magFilter = magFilter self.defined = False self.id = 0 def define(self): img = Image.open(self.file).transpose(Image.FLIP_TOP_BOTTOM).convert('RGBA') width = 2 while width < img.size[0]: width *= 2 width /= 2 if (width != img.size[0]): img = img.resize((width,img.size[1])) self.id = glGenTextures(1) glBindTexture(GL_TEXTURE_1D, self.id) glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, self.wrapS) glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, self.minFilter) glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, self.magFilter) if (self.minFilter == GL_NEAREST_MIPMAP_NEAREST) or \ (self.minFilter == GL_NEAREST_MIPMAP_LINEAR) or \ (self.minFilter == GL_LINEAR_MIPMAP_NEAREST) or \ (self.minFilter == GL_LINEAR_MIPMAP_LINEAR): gluBuild1DMipmaps(GL_TEXTURE_1D, GL_RGBA, img.size[0], GL_RGBA, GL_UNSIGNED_BYTE, img.tostring()) else: glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA, img.size[0], 0, GL_RGBA, GL_UNSIGNED_BYTE, img.tostring()) glBindTexture(GL_TEXTURE_1D, 0) self.defined = True def apply(self): if not self.defined: self.define() glBindTexture(GL_TEXTURE_1D, self.id) if self.id != 0: glEnable(GL_TEXTURE_1D) else: glDisable(GL_TEXTURE_1D) def disable(self): glBindTexture(GL_TEXTURE_1D, 0) glDisable(GL_TEXTURE_1D) class Camera: def __init__(self): self.position = Vector([0,0,0]) self.xRot = 0 self.yRot = 0 def applyProjection(self): glMatrixMode(GL_PROJECTION) glLoadIdentity() glMatrixMode(GL_MODELVIEW) def apply(self): self.applyProjection() glLoadIdentity() glRotatef(-self.xRot, 1, 0, 0) glRotatef(-self.yRot, 0, 1, 0) glTranslatef(-self.position[0], -self.position[1], -self.position[2]) def turn(self, angle): self.yRot += angle def pitch(self, angle): self.xRot += angle def moveForward(self, distance): self.move(self.forward() * distance) def moveBackward(self, distance): self.move(self.backward() * distance) def moveLeft(self, distance): self.move(self.left() * distance) def moveRight(self, distance): self.move(self.right() * distance) def moveUp(self, distance): self.move(self.up() * distance) def moveDown(self, distance): self.move(self.down() * distance) def move(self, delta): self.position += delta def forward(self): xr = self.xRot * math.pi / 180.0 yr = self.yRot * math.pi / 180.0 return Vector([-math.sin(yr)*math.cos(xr), math.sin(xr), -math.cos(yr) * math.cos(xr)]) def left(self): xr = self.xRot * math.pi / 180.0 yr = self.yRot * math.pi / 180.0 return Vector([-math.cos(yr), 0, math.sin(yr)]) def up(self): xr = self.xRot * math.pi / 180.0 yr = self.yRot * math.pi / 180.0 return Vector([math.sin(yr)*math.sin(xr), math.cos(xr), math.cos(yr) * math.sin(xr)]) def backward(self): xr = self.xRot * math.pi / 180.0 yr = self.yRot * math.pi / 180.0 return Vector([math.sin(yr)*math.cos(xr), -math.sin(xr), math.cos(yr) * math.cos(xr)]) def right(self): xr = self.xRot * math.pi / 180.0 yr = self.yRot * math.pi / 180.0 return Vector([math.cos(yr), 0, -math.sin(yr)]) def down(self): xr = self.xRot * math.pi / 180.0 yr = self.yRot * math.pi / 180.0 return Vector([-math.sin(yr)*math.sin(xr), -math.cos(xr), -math.cos(yr) * math.sin(xr)]) class PerspCamera(Camera): def __init__(self, fovy=45.0, aspect=1.0, near=1.0, far=100.0): Camera.__init__(self) self.fovy = fovy self.aspect = aspect self.near = near self.far = far def applyProjection(self): glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(self.fovy, self.aspect, self.near, self.far) glMatrixMode(GL_MODELVIEW) def zoom(self, angle): newFovy = self.fovy + angle if (newFovy > 0.0) and (newFovy < 180.0): self.fovy = newFovy class OrthoCamera(Camera): def __init__(self, left=0, right=1, bottom=0, top=1, near=-1, far=1): Camera.__init__(self) self.left = left self.right = right self.bottom = bottom self.top = top self.near = near self.far = far def applyProjection(self): glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(self.left, self.right, self.bottom, self.top, self.near, self.far) glMatrixMode(GL_MODELVIEW) class WFObject: class wfface: def __init__(self): self.points = [] def draw(self): glBegin(GL_POLYGON) for p in self.points: if p.has_key('vn'): glNormal3fv(p['vn']) if p.has_key('vt'): glTexCoord2fv(p['vt']) glVertex3fv(p['v']) glEnd() class wfline: def __init__(self): self.points = [] def draw(self): glBegin(GL_LINE_STRIP) for p in self.points: if p.has_key('vn'): glNormal3fv(p['vn']) if p.has_key('vt'): glTexCoord2fv(p['vt']) glVertex3fv(p['v']) glEnd() class wfpoints: def __init__(self): self.points = [] def draw(self): glBegin(GL_POINTS) for p in self.points: if p.has_key('vn'): glNormal3fv(p['vn']) if p.has_key('vt'): glTexCoord2fv(p['vt']) glVertex3fv(p['v']) glEnd() class wfmaterial: def __init__(self): self.illum = 2 self.Kd = [1, 1, 1, 1] self.Ka = [0, 0, 0, 0] self.Ks = [0, 0, 0, 0] self.Ns = 0 self.texture = None def draw(self): glMaterialfv(GL_FRONT, GL_DIFFUSE, self.Kd) glMaterialfv(GL_FRONT, GL_AMBIENT, self.Ka) if self.illum > 1: glMaterialfv(GL_FRONT, GL_SPECULAR, self.Ks) glMaterialf(GL_FRONT, GL_SHININESS, self.Ns) else: glMaterialfv(GL_FRONT, GL_SPECULAR, [0,0,0,0]) if self.texture: self.texture.apply() else: glDisable(GL_TEXTURE_2D) def __init__(self, filename=None): self.v = [] self.vn = [] self.vt = [] self.mtl = [] self.geometry = [] self.materials = {} self.displayListInitted = False self.hasNormals = False if filename: self.loadFile(filename) def loadFile(self, filename): self.fileName = filename self.lineNum = 0 for line in open(filename, 'r').readlines(): self.lineNum += 1 values = string.split(line) if len(values) < 1: continue elif values[0] == 'v': self.parseVertex(values) elif values[0] == 'vn': self.parseNormal(values) elif values[0] == 'vt': self.parseTexCoord(values) elif (values[0] == 'f') or (values[0] == 'fo'): self.parseFace(values) elif values[0] == 'l': self.parseLine(values) elif values[0] == 'p': self.parsePoints(values) elif values[0] == 'mtllib': self.parseMtllib(values) elif values[0] == 'usemtl': self.parseUsemtl(values) def parseVertex(self, val): if len(val) < 4: print 'warning: incomplete vertex info:', self.fileName, 'line', self.lineNum self.v.append([0, 0, 0]) else: self.v.append([string.atof(val[1]), string.atof(val[2]), string.atof(val[3])]) def parseNormal(self, val): if len(val) < 4: print 'warning: incomplete normal info:', self.fileName, 'line', self.lineNum self.vn.append([0, 0, 0]) else: self.vn.append([string.atof(val[1]), string.atof(val[2]), string.atof(val[3])]) self.hasNormals = True def parseTexCoord(self, val): if len(val) < 3: print 'warning: incomplete texcoord info:', self.fileName, 'line', self.lineNum self.vt.append([0, 0]) else: self.vt.append([string.atof(val[1]), string.atof(val[2])]) def parseFace(self, val): if len(val) < 4: return face = WFObject.wfface() face.points = self.parsePointList(val) self.geometry.append(face) def parseLine(self, val): if len(val) < 3: return line = WFObject.wfline() line.points = self.parsePointList(val) self.geometry.append(line) def parsePoints(self, val): if len(val) < 2: return pt = WFObject.wfpoints() pt.points = self.parsePointList(val) self.geometry.append(pt) def parsePointList(self, val): points = [] for v in val[1:]: p = { } data = string.split(v,'/') if len(data) > 0: index = string.atoi(data[0]) if index > 0: p['v'] = self.v[index-1] elif index < 0: p['v'] = self.v[len(self.v)+index] if len(data) > 1: index = string.atoi('0'+data[1]) if index > 0: p['vt'] = self.vt[index-1] elif index < 0: p['vt'] = self.vt[len(self.vt)+index] if len(data) > 2: index = string.atoi('0'+data[2]) if index > 0: p['vn'] = self.vn[index-1] elif index < 0: p['vn'] = self.vn[len(self.vn)+index] points.append(p) return points def parseMtllib(self, val): if len(val) < 2: return curmtl = WFObject.wfmaterial() for line in open(val[1]).readlines(): values = string.split(line) if len(values) < 1: continue if values[0] == 'newmtl': curmtl = WFObject.wfmaterial() if len(values) > 1: self.materials[values[1]] = curmtl elif values[0] == 'illum': if len(values) > 1: curmtl.illum = string.atoi(values[1]) elif values[0] == 'Ns': if len(values) > 1: curmtl.Ns = string.atof(values[1]) elif values[0] == 'Kd': if len(values) > 3: curmtl.Kd = [string.atof(values[1]), string.atof(values[2]), string.atof(values[3]), 1] elif values[0] == 'Ka': if len(values) > 3: curmtl.Ka = [string.atof(values[1]), string.atof(values[2]), string.atof(values[3]), 1] elif values[0] == 'Ks': if len(values) > 3: curmtl.Ks = [string.atof(values[1]), string.atof(values[2]), string.atof(values[3]), 1] elif values[0] == 'map_Kd': if len(values) > 1: curmtl.texture = Texture2D(values[1]) def parseUsemtl(self, val): if len(val) < 2: return self.geometry.append(self.materials[val[1]]) def draw(self): if not self.displayListInitted: self.displayList = glGenLists(1) glNewList(self.displayList, GL_COMPILE) if self.hasNormals: glPushAttrib(GL_ENABLE_BIT) glEnable(GL_LIGHTING) for g in self.geometry: g.draw() if self.hasNormals: glPopAttrib() glEndList() self.displayListInitted = True glCallList(self.displayList) class Transform: def apply(self): pass def pushApply(self): glPushMatrix() self.apply() def pop(self): glPopMatrix() class SimpleTransform(Transform): def __init__(self, translate=[0,0,0], rotateAngle=0, rotateAxis=[1,0,0], scale=[1,1,1]): self.translate = translate self.rotateAngle = rotateAngle self.rotateAxis = rotateAxis self.scale = scale def apply(self): glTranslatef(self.translate[0], self.translate[1], self.translate[2]) glRotatef(self.rotateAngle, self.rotateAxis[0], self.rotateAxis[1], self.rotateAxis[2]) glScalef(self.scale[0], self.scale[1], self.scale[2]) def drawStrokeString(text, position=None, font=GLUT_STROKE_ROMAN): glPushMatrix() if position: glTranslatef(position[0], position[1], position[2]) glScalef(0.01, 0.01, 0.01) for c in text: glutStrokeCharacter(font, ord(c)) glPopMatrix() def drawBitmapString(text, position=None, font=GLUT_BITMAP_TIMES_ROMAN_24): if position: if len(position) > 2: glRasterPos3fv(position) else: glRasterPos2fv(position) for c in text: glutBitmapCharacter(font, ord(c)) def drawAxes(): X_Axis.drawLine(); drawBitmapString("X",X_Axis,GLUT_BITMAP_TIMES_ROMAN_24); Y_Axis.drawLine(); drawBitmapString("Y",Y_Axis,GLUT_BITMAP_TIMES_ROMAN_24); Z_Axis.drawLine(); drawBitmapString("Z",Z_Axis,GLUT_BITMAP_TIMES_ROMAN_24); def degreesToRadians(angle): return angle * math.pi / 180.0 def radiansToDegrees(angle): return angle * 180.0 / math.pi def computeNormal(v0, v1, v2): A = [ v2[0] - v1[0], v2[1] - v1[1], v2[2] - v1[2] ] B = [ v0[0] - v1[0], v0[1] - v1[1], v0[2] - v1[2] ] product = [ A[1] * B[2] - A[2] * B[1], A[2] * B[0] - A[0] * B[2], A[0] * B[1] - A[1] * B[0] ] length = math.sqrt(product[0]*product[0] + product[1]*product[1] + product[2]*product[2]) if (length == 0): # If there's a problem, return Y_Axis # return an arbitrary result else: return Vector([ product[0]/length, product[1]/length, product[2]/length ]) class Transparency: def __init__(self, blendSource=GL_ONE, blendDest=GL_ZERO, alphaFunc=GL_ALWAYS, alphaRef=0.0): self.blendSource = blendSource self.blendDest = blendDest self.alphaFunc = alphaFunc self.alphaRef = alphaRef def apply(self): if self.blendSource != GL_ONE or self.blendDest != GL_ZERO: glEnable(GL_BLEND) glBlendFunc(self.blendSource, self.blendDest) if self.alphaFunc != GL_ALWAYS: glEnable(GL_ALPHA_TEST) glAlphaFunc(self.alphaFunc, self.alphaRef) def disable(self): glDisable(GL_BLEND) glDisable(GL_ALPHA_TEST) class Fog: def __init__(self, mode=GL_EXP, color=[1,1,1,1], density=1, start=0, end=1): self.mode = mode self.color = color self.density = density self.start = start self.end = end def apply(self): if self.mode == GL_LINEAR: glEnable(GL_FOG) glFogi(GL_FOG_MODE, self.mode) glFogfv(GL_FOG_COLOR, self.color) glFogf(GL_FOG_START, self.start) glFogf(GL_FOG_END, self.end) elif self.mode == GL_EXP or self.mode == GL_EXP2: glEnable(GL_FOG) glFogi(GL_FOG_MODE, self.mode) glFogfv(GL_FOG_COLOR, self.color) glFogf(GL_FOG_DENSITY, self.density) def disable(self): glDisable(GL_FOG)