...
 
Commits (6)
24-06-2018
Version 1.3.6
[Updated] - Switch to GitLab repository
- Switch to MIT licence
07-05-2017
Version 1.3.5
[Added] - readline-safe stylize_interactive() #6
[Added] - readline-safe stylize_interactive() #6
20-01-2017
Version 1.3.4
......
This diff is collapsed.
.. image:: https://img.shields.io/github/release/dslackw/colored.svg
:target: https://github.com/dslackw/colored/releases
.. image:: https://travis-ci.org/dslackw/colored.svg?branch=master
:target: https://travis-ci.org/dslackw/colored
.. image:: https://landscape.io/github/dslackw/colored/master/landscape.png
:target: https://landscape.io/github/dslackw/colored/master
.. image:: https://img.shields.io/codacy/92d31df45d6740ec96c3864126453928.svg
:target: https://www.codacy.com/public/dzlatanidis/colored/dashboard
.. image:: https://img.shields.io/pypi/dm/colored.svg
:target: https://pypi.python.org/pypi/colored
.. image:: https://img.shields.io/badge/license-GPLv3-blue.svg
:target: https://github.com/dslackw/colored
.. image:: https://img.shields.io/github/stars/dslackw/colored.svg
:target: https://github.com/dslackw/colored
.. image:: https://img.shields.io/github/forks/dslackw/colored.svg
:target: https://github.com/dslackw/colored
.. image:: https://img.shields.io/github/issues/dslackw/colored.svg
:target: https://github.com/dslackw/colored/issues
Very simple Python library for color and formatting in terminal.
Collection of color codes and names for 256 color terminal setups.
The following is a list of 256 colors for Xterm, containing an example
of the displayed color, Xterm Name, Xterm Number and HEX.
.. image:: https://raw.githubusercontent.com/dslackw/images/master/colored/logo.png
:target: https://github.com/dslackw/colored
.. image:: https://gitlab.com/dslackw/images/raw/master/colored/logo.png
:target: https://gitlab.com/dslackw/colored
`[CHANGELOG] <https://github.com/dslackw/colored/blob/master/CHANGELOG>`_
`[CHANGELOG] <https://gitlab.com/dslackw/colored/blob/master/CHANGELOG>`_
Video Demo
----------
.. image:: https://raw.githubusercontent.com/dslackw/images/master/colored/video.png
.. image:: https://gitlab.com/dslackw/images/raw/master/colored/video.png
:target: https://asciinema.org/a/10712
The following colors works with most terminals and terminals emulators.
......@@ -328,12 +308,12 @@ Attributes:
256 Colors Foreground (text):
.. image:: https://raw.githubusercontent.com/dslackw/images/master/colored/256_colors_fg.png
.. image:: https://gitlab.com/dslackw/images/raw/master/colored/256_colors_fg.png
:alt: 256 fg colors
256 Colors Background:
.. image:: https://raw.githubusercontent.com/dslackw/images/master/colored/256_colors_bg.png
.. image:: https://gitlab.com/dslackw/images/raw/master/colored/256_colors_bg.png
:alt: 256 bg colors
......@@ -457,5 +437,5 @@ Import colored module:
Screenshot:
.. image:: https://raw.githubusercontent.com/dslackw/images/master/colored/screenshot-2.png
.. image:: https://gitlab.com/dslackw/images/raw/master/colored/screenshot-2.png
:alt: example
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
__init__.py is a part of colored.
Copyright 2014-2017 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
All rights reserved.
Colored is very simple Python library for color and formatting in terminal.
https://github.com/dslackw/colored
colored is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from __future__ import print_function
......@@ -30,5 +9,5 @@ from .fore import *
from .back import *
from .style import *
__version_info__ = (1, 3, 5)
__version_info__ = (1, 3, 6)
__version__ = '{0}.{1}.{2}'.format(*__version_info__)
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
back.py is a part of colored.
Copyright 2014-2017 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
All rights reserved.
Colored is very simple Python library for color and formatting in terminal.
https://github.com/dslackw/colored
colored is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from .colors import names
......
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
colored.py is a part of colored.
Copyright 2014-2017 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
All rights reserved.
Colored is very simple Python library for color and formatting in terminal.
https://github.com/dslackw/colored
colored is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
_ _
___ ___ | | ___ _ __ ___ __| |
/ __/ _ \| |/ _ \| "__/ _ \/ _` |
| (_| (_) | | (_) | | | __/ (_| |
\___\___/|_|\___/|_| \___|\__,_|
Very simple Python library for color and formatting in terminal.
Collection of color codes and names for 256 color terminal setups.
The following is a list of 256 colors for Xterm, containing an example
of the displayed color, Xterm Name, Xterm Number.
"""
from .hex import HEX
......@@ -404,6 +372,6 @@ def stylize_interactive(text, styles, reset=True):
safety."""
# problem: readline includes bare ANSI codes in width calculations.
# solution: wrap nonprinting codes in SOH/STX when necessary.
# see: https://github.com/dslackw/colored/issues/5
# see: https://gitlab.com/dslackw/colored/issues/5
terminator = _c0wrap(attr("reset")) if reset else ""
return "{}{}{}".format(_c0wrap(styles), text, terminator)
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
colors.py is a part of colored.
Copyright 2014-2017 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
All rights reserved.
Colored is very simple Python library for color and formatting in terminal.
https://github.com/dslackw/colored
colored is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
names = [
'BLACK',
......
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
fore.py is a part of colored.
Copyright 2014-2017 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
All rights reserved.
Colored is very simple Python library for color and formatting in terminal.
https://github.com/dslackw/colored
colored is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from .colors import names
......
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
hex.py is a part of colored.
Copyright 2014-2017 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
All rights reserved.
Colored is very simple Python library for color and formatting in terminal.
https://github.com/dslackw/colored
colored is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
def HEX(color):
......@@ -283,7 +261,6 @@ def HEX(color):
"253": "#dadada",
"254": "#e4e4e4",
"255": "#eeeeee"
}
# swap keys for values
......
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
style.py is a part of colored.
Copyright 2014-2017 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
All rights reserved.
Colored is very simple Python library for color and formatting in terminal.
https://github.com/dslackw/colored
colored is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
class style(object):
......
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
setup.py is a part of colored.
Copyright 2014-2016 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
All rights reserved.
Colored is very simple Python library for color and formatting in terminal.
https://github.com/dslackw/colored
colored is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from distutils.core import setup
from colored import __version__
......@@ -36,7 +15,7 @@ setup(
"python"],
author="dslackw",
author_email="d.zlatanidis@gamil.com",
url="https://github.com/dslackw/colored",
url="https://gitlab.com/dslackw/colored",
package_data={"": ["LICENSE", "README.rst", "CHANGELOG"]},
classifiers=[
"Development Status :: 5 - Production/Stable",
......