1
#------------------------------------------------------------------------------
3
# Copyright (c) 2005, Enthought, Inc.
6
# This software is provided without warranty under the terms of the BSD
7
# license included in enthought/LICENSE.txt and may be redistributed only
8
# under the conditions described in the aforementioned license. The license
9
# is also available online at http://www.enthought.com/licenses/BSD.txt
11
# Thanks for using Enthought open source!
13
# Author: David C. Morrill
16
#------------------------------------------------------------------------------
18
""" Defines a subclass of the base color editor factory, for colors
19
that are represented as tuples of the form ( *red*, *green*, *blue* ),
20
where *red*, *green* and *blue* are floats in the range from 0.0 to 1.0.
23
#-------------------------------------------------------------------------------
25
#-------------------------------------------------------------------------------
27
from __future__ import absolute_import
29
from .color_editor import ToolkitEditorFactory as EditorFactory
31
from ..toolkit import toolkit_object
33
#-------------------------------------------------------------------------------
34
# 'ToolkitEditorFactory' class:
35
#-------------------------------------------------------------------------------
37
class ToolkitEditorFactory ( EditorFactory ):
38
""" Factory for editors for RGB colors.
42
# Define the RGBColorEditor class
43
# The function will try to return the toolkit-specific editor factory (located
44
# in traitsui.<toolkit>.rgb_color_editor, and if none is found, the
45
# ToolkitEditorFactory declared here is returned.
46
def RGBColorEditor(*args, **traits):
47
""" Returns an instance of the toolkit-specific editor factory declared in
48
traitsui.<toolkit>.rgb_color_editor. If such an editor factory
49
cannot be located, an instance of the abstract ToolkitEditorFactory
50
declared in traitsui.editors.rgb_color_editor is returned.
55
arguments and keywords to be passed on to the editor
56
factory's constructor.
60
return toolkit_object('rgb_color_editor:ToolkitEditorFactory', True)(
63
return ToolkitEditorFactory(*args, **traits)