Archive for the 'Kiva' category

ETS 3.6 and github

Jan 31 2011 Published by under Chaco, Enable, Enthought Tool Suite, Kiva, Qt, Traits

Last week, we released the Enthought Tool Suite 3.6. John Wiggins made many improvements and bug fixes to Kiva, Enable, and Chaco. And thanks to Evan Patterson, the TraitsBackendQt now supports PySide (as well as PyQt4).

We are also happy to announce that immediately after the release, the ETS repository was moved from subversion to git, and is now hosted on github.

This new ETS will be included in EPD 7.0, which is Python 2.7-based and is scheduled to be released on February 8.

No responses yet

Gradients in Enable

Jul 22 2009 Published by under Enable, Kiva, NumPy

A little while ago I added basic support for gradients in Kiva (and thus Enable). Its been slowly improving, and I think its at a point where it should be shared with a greater audience. Kiva now supports linear and radial gradients as path fills. My goal is to support the majority of what the SVG spec requires, currently we pass about 1/2 to 2/3 of the compliance tests.

I have added a couple of full examples in Enable/examples/kiva, here is an excerpt:

# colors are 5 doubles: offset, red, green, blue, alpha
starting_color = numpy.array([0.0, 1.0, 1.0, 1.0, 1.0])
ending_color = numpy.array([1.0, 0.0, 0.0, 0.0, 1.0])

# diagonal
gc.rect(50,25,150,100)
gc.linear_gradient(50,25,150,125,
    numpy.array([starting_color, ending_color]),
    "pad")
gc.draw_path()

That is all the code required to draw a rectangle with a diagonal gradient. And here is a screenshot of the example I took this from:

kiva gradient screenshot

No responses yet

Older posts »

Featuring Advanced Search Functions plugin by YD