library to convert Xonotic color strings to various other formats
Project description
# python-dpcolors
[![Build Status](https://travis-ci.org/nsavch/python-dpcolors.svg?branch=master)](https://travis-ci.org/nsavch/python-dpcolors)
Python library for converting DarkPlaces color strings to various other formats
Supports the following conversions
* dp -> irc
* dp -> ansi 8 bit
* dp -> ansi 24 bit
* irc -> dp
* irc -> ansi 8 bit
* irc -> ansi 24 bit
# Installation
```bash
pip install python-dpcolors
```
# Example usage
```python
from dpcolors import ColorString
cs = ColorString.from_dp('^3hello')
print(cs.to_irc())
print(cs.to_ansi_8bit())
print(cs.to_ansi_24bit())
cs = ColorString.from_irc('\x0305hello')
print(cs.to_dp())
```
[![Build Status](https://travis-ci.org/nsavch/python-dpcolors.svg?branch=master)](https://travis-ci.org/nsavch/python-dpcolors)
Python library for converting DarkPlaces color strings to various other formats
Supports the following conversions
* dp -> irc
* dp -> ansi 8 bit
* dp -> ansi 24 bit
* irc -> dp
* irc -> ansi 8 bit
* irc -> ansi 24 bit
# Installation
```bash
pip install python-dpcolors
```
# Example usage
```python
from dpcolors import ColorString
cs = ColorString.from_dp('^3hello')
print(cs.to_irc())
print(cs.to_ansi_8bit())
print(cs.to_ansi_24bit())
cs = ColorString.from_irc('\x0305hello')
print(cs.to_dp())
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-dpcolors-0.1.0.tar.gz
(6.4 kB
view hashes)
Built Distribution
Close
Hashes for python_dpcolors-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a74e8d133045111531a80a57d92f62ae8f102e4a9647a789f3ea32416673f3cd |
|
MD5 | 6640901173117479c33ae71c4f64663a |
|
BLAKE2b-256 | 55bf71fc91e5b80cb711eb9dbfcc957433d9a6d84fcf84f81cd850f9e11cfe0e |