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.1.tar.gz
(6.7 kB
view details)
Built Distribution
File details
Details for the file python-dpcolors-0.1.1.tar.gz
.
File metadata
- Download URL: python-dpcolors-0.1.1.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4ec53f1879a2211a2fe9478a2a49f3c7af09d2d5426ca7b689478ac2778e525 |
|
MD5 | 847e8faa14db22d78cc38d7b61f5c838 |
|
BLAKE2b-256 | 6b44ed3241e12f2b6e73b9bece23ada698e35eb97fd72b0b73330b45bf4ff2bf |
File details
Details for the file python_dpcolors-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: python_dpcolors-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42f613f8089403e19c2f704dd00ea1cb942691e3ba32beb99e21480df2af96bd |
|
MD5 | ed860fbf0aac11bdbe5fb0f0b30205b6 |
|
BLAKE2b-256 | ef0e24525ec8612a65e2f12596fe17ef35956cea231c3283de43f0af3b4463a7 |