/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/common.py
ViewVC logotype

Contents of /branches/WIP-pyshapelib-bramz/Thuban/UI/common.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 438 - (show annotations)
Thu Feb 27 15:53:48 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/UI/common.py
File MIME type: text/x-python
File size: 777 byte(s)
Common functions used in several UI modules

1 # Copyright (c) 2001 by Intevation GmbH
2 # Authors:
3 # Jonathan Coles <[email protected]>
4 #
5 # This program is free software under the GPL (>=v2)
6 # Read the file COPYING coming with Thuban for details.
7
8 from Thuban.Model.color import Color
9 from wxPython.wx import wxColour
10
11 def Color2wxColour(color):
12 assert(color is not None)
13 assert(isinstance(color, Color))
14 return wxColour(color.red * 255,
15 color.green * 255,
16 color.blue * 255)
17
18 def wxColour2Color(colour):
19 assert(colour is not None)
20 # this doesn't work because colour is really a wxColourPtr!
21 #assert(isinstance(colour, wxColour))
22 return Color(colour.Red() / 255.0,
23 colour.Green() / 255.0,
24 colour.Blue() / 255.0)
25

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26