Skip to main content

Colorset management classes

Project description

Colorset

A set of classes for working with color legends.

Usage

To use the library, you need to import it and call the function getLegend(cs_file, sys_cs_file, colorset_used), where cs_file is the full name of the main legend XML file, sys_cs_file is the full name of the additional legend XML file, and colorset_used is the name of the desired legend.

The function returns a tuple legend, colorType, where legend is an object of the class ColorSetNumerical, ColorSetString, or ColorSetAutomatic, depending on the contents of the legend files, and colorType is a string indicating the type of legend from the list ['numerical', 'string', 'automatic'].

The following methods are supported:

show() - displays the contents of the legend in the standard console. createDescription() - automatically fills in the description property. valueToColor(value) - calculates the integer color code based on the parameter value.

Required Files

Main and additional XML files containing the color legends.

Integration

The library requires the presence of lxml.etree for operation.

Related Projects

The library was developed for use with its own projects.

Future Plans

Implementation of the ability to edit legends and save them in XML files. Integration to work with a PostgreSQL database. Preparation of a GUI - a visual legend editor.

Current Status

Debugging.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

colorset-1.0.0.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

colorset-1.0.0-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page