Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7bb049ea20 | |||
| 73becf78c4 | |||
| 7f949fe6b2 | |||
| 9abdae5fb4 | |||
| 6ff45d0edd | |||
| 99f99efc1c | |||
| 0c08b3950f | |||
| 2fc419476d | |||
| abac3b2bb3 | |||
| 43924305b9 | |||
| 29f771caec | |||
| 35f5e6eec9 | |||
| 0a7356a560 | |||
| 6a5edd037a | |||
| 2b5ef302a5 | |||
| 81364f55a2 | |||
| 6209018caa | |||
| b9dfa5e200 | |||
| 9ec3f74c0d | |||
| 39e14aec90 | |||
| 5d08179cea | |||
| 1ff2ea73ec | |||
| 71fb76d4f7 | |||
| a687cb328e | |||
| 0a6a61a013 |
@@ -1,3 +1,84 @@
|
|||||||
|
# HyFetch
|
||||||
|
|
||||||
|
neofetch with pride flags <3
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### Method 1: Install using Python pip (Recommended)
|
||||||
|
|
||||||
|
Install Python >= 3.7 first. Then, just do:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pip install hyfetch
|
||||||
|
```
|
||||||
|
|
||||||
|
### Method 2: Install using system package manager
|
||||||
|
|
||||||
|
Currently, these distributions have existing packages for HyFetch:
|
||||||
|
|
||||||
|
* ArchLinux: `yay -S hyfetch` (Thanks to @ Aleksana)
|
||||||
|
* Guix: [In progress](https://issues.guix.gnu.org/54847#8-lineno27)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
When you run `hyfetch` for the first time, it will prompt you to choose a color system and a preset. Just follow the prompt, and everything should work (hopefully). If something doesn't work, feel free to submit an issue!
|
||||||
|
|
||||||
|
#### Q: How do I change my config?
|
||||||
|
|
||||||
|
A: Use `hyfetch -c`
|
||||||
|
|
||||||
|
#### Q: What do I do if the color is too dark/light for my theme?
|
||||||
|
|
||||||
|
A: You can try setting the colors' "lightness" using the `--c-set-l` parameter. The value should be between 0 and 1. For example, if you are using dark theme and the rainbow flag is too dark to display, you can type:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
hyfetch -p rainbow --c-set-l 0.8
|
||||||
|
```
|
||||||
|
|
||||||
|
Feel free to experiment with it!
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Change Log
|
||||||
|
|
||||||
|
### TODO
|
||||||
|
|
||||||
|
* [ ] Add interactive configurator for adjusting brightness
|
||||||
|
* [ ] Add configuration to emphasize certain parts of the original ASCII art (to make icons like Fedora and Ubuntu look nicer)
|
||||||
|
|
||||||
|
### 1.0.5
|
||||||
|
|
||||||
|
* Fix terminal emulator detection ([PR #2](https://github.com/hykilpikonna/hyfetch/pull/2))
|
||||||
|
|
||||||
|
### 1.0.4
|
||||||
|
|
||||||
|
* Add more flags ([PR #1](https://github.com/hykilpikonna/hyfetch/pull/1))
|
||||||
|
|
||||||
|
### 1.0.3
|
||||||
|
|
||||||
|
* Fix missing dependency for setuptools
|
||||||
|
|
||||||
|
### 1.0.2
|
||||||
|
|
||||||
|
* Implement RGB to 8bit conversion
|
||||||
|
* Add support for Python 3.7 and 3.8
|
||||||
|
|
||||||
|
### 1.0.1
|
||||||
|
|
||||||
|
* Included 11 flag presets
|
||||||
|
* Ability to lighten colors with `--c-set-l <lightness>`
|
||||||
|
* Command-line flag chooser
|
||||||
|
* Supports Python >= 3.9
|
||||||
|
|
||||||
|
## More Screenshots
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
## Original Readme from Neofetch Below
|
||||||
|
|
||||||
<h3 align="center"><img src="https://i.imgur.com/ZQI2EYz.png" alt="logo" height="100px"></h3>
|
<h3 align="center"><img src="https://i.imgur.com/ZQI2EYz.png" alt="logo" height="100px"></h3>
|
||||||
<p align="center">A command-line system information tool written in bash 3.2+</p>
|
<p align="center">A command-line system information tool written in bash 3.2+</p>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Stop on error
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Remove old build
|
||||||
|
rm -rf dist/*
|
||||||
|
rm -rf build/*
|
||||||
|
|
||||||
|
# Build
|
||||||
|
python setup.py sdist bdist_wheel
|
||||||
|
|
||||||
|
# Check built files
|
||||||
|
twine check dist/*
|
||||||
|
|
||||||
|
# Upload
|
||||||
|
twine upload dist/*
|
||||||
+5
-2
@@ -1,6 +1,9 @@
|
|||||||
__version__ = '1.0.1'
|
from __future__ import annotations
|
||||||
|
|
||||||
from . import main
|
from . import main
|
||||||
|
|
||||||
|
|
||||||
|
__version__ = '1.0.5'
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main.run()
|
main.run()
|
||||||
|
|||||||
+32
-4
@@ -1,5 +1,10 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import colorsys
|
import colorsys
|
||||||
from typing import NamedTuple
|
from typing import NamedTuple
|
||||||
|
from typing_extensions import Literal
|
||||||
|
|
||||||
|
AnsiMode = Literal['default', 'ansi', '8bit', 'rgb']
|
||||||
|
|
||||||
|
|
||||||
def redistribute_rgb(r: int, g: int, b: int) -> tuple[int, int, int]:
|
def redistribute_rgb(r: int, g: int, b: int) -> tuple[int, int, int]:
|
||||||
@@ -61,17 +66,32 @@ class RGB(NamedTuple):
|
|||||||
c = '38' if foreground else '48'
|
c = '38' if foreground else '48'
|
||||||
return f'\033[{c};2;{self.r};{self.g};{self.b}m'
|
return f'\033[{c};2;{self.r};{self.g};{self.b}m'
|
||||||
|
|
||||||
def to_ansi_256(self, foreground: bool = True) -> str:
|
def to_ansi_8bit(self, foreground: bool = True) -> str:
|
||||||
"""
|
"""
|
||||||
Convert RGB to ANSI 256 Color Escape Code.
|
Convert RGB to ANSI 8bit 256 Color Escape Code.
|
||||||
|
|
||||||
This encoding supports 256 colors in total.
|
This encoding supports 256 colors in total.
|
||||||
|
|
||||||
:return: ANSI 256 escape code like \033[38;5;206m'
|
:return: ANSI 256 escape code like \033[38;5;206m'
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError()
|
r, g, b = self.r, self.g, self.b
|
||||||
|
sep = 42.5
|
||||||
|
|
||||||
def to_ansi_16(self) -> str:
|
while True:
|
||||||
|
if r < sep or g < sep or b < sep:
|
||||||
|
gray = r < sep and g < sep and b < sep
|
||||||
|
break
|
||||||
|
sep += 42.5
|
||||||
|
|
||||||
|
if gray:
|
||||||
|
color = 232 + (r + g + b) / 33
|
||||||
|
else:
|
||||||
|
color = 16 + int(r / 256. * 6) * 36 + int(g / 256. * 6) * 6 + int(b / 256. * 6)
|
||||||
|
|
||||||
|
c = '38' if foreground else '48'
|
||||||
|
return f'\033[{c};5;{int(color)}m'
|
||||||
|
|
||||||
|
def to_ansi_16(self, foreground: bool = True) -> str:
|
||||||
"""
|
"""
|
||||||
Convert RGB to ANSI 16 Color Escape Code
|
Convert RGB to ANSI 16 Color Escape Code
|
||||||
|
|
||||||
@@ -79,6 +99,14 @@ class RGB(NamedTuple):
|
|||||||
"""
|
"""
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def to_ansi(self, mode: AnsiMode, foreground: bool = True):
|
||||||
|
if mode == 'rgb':
|
||||||
|
return self.to_ansi_rgb(foreground)
|
||||||
|
if mode == '8bit':
|
||||||
|
return self.to_ansi_8bit(foreground)
|
||||||
|
if mode == 'ansi':
|
||||||
|
return self.to_ansi_16(foreground)
|
||||||
|
|
||||||
def lighten(self, multiplier: float) -> 'RGB':
|
def lighten(self, multiplier: float) -> 'RGB':
|
||||||
"""
|
"""
|
||||||
Lighten the color by a multiplier
|
Lighten the color by a multiplier
|
||||||
|
|||||||
+7
-5
@@ -1,13 +1,15 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Literal, Iterable
|
from typing import Iterable
|
||||||
|
|
||||||
from hypy_utils import printc, json_stringify, color
|
from hypy_utils import printc, json_stringify, color
|
||||||
|
|
||||||
|
from .color_util import AnsiMode
|
||||||
from .neofetch_util import run_neofetch
|
from .neofetch_util import run_neofetch
|
||||||
from .presets import PRESETS, ColorProfile
|
from .presets import PRESETS, ColorProfile
|
||||||
|
|
||||||
@@ -18,7 +20,7 @@ CONFIG_PATH.parent.mkdir(exist_ok=True, parents=True)
|
|||||||
@dataclass
|
@dataclass
|
||||||
class Config:
|
class Config:
|
||||||
preset: str
|
preset: str
|
||||||
mode: Literal['default', 'ansi', '8bit', 'rgb']
|
mode: AnsiMode
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
CONFIG_PATH.write_text(json_stringify(self), 'utf-8')
|
CONFIG_PATH.write_text(json_stringify(self), 'utf-8')
|
||||||
@@ -95,7 +97,7 @@ def create_config() -> Config:
|
|||||||
# Select color system
|
# Select color system
|
||||||
# TODO: Demo of each color system
|
# TODO: Demo of each color system
|
||||||
color_system = literal_input('Which &acolor &bsystem &rdo you want to use?',
|
color_system = literal_input('Which &acolor &bsystem &rdo you want to use?',
|
||||||
['ansi', '8bit', 'rgb'], 'rgb')
|
['8bit', 'rgb'], 'rgb')
|
||||||
|
|
||||||
# Print preset
|
# Print preset
|
||||||
print('Available presets:\n')
|
print('Available presets:\n')
|
||||||
@@ -135,7 +137,7 @@ def run():
|
|||||||
|
|
||||||
parser.add_argument('-c', '--config', action='store_true', help=color(f'Configure {hyfetch}'))
|
parser.add_argument('-c', '--config', action='store_true', help=color(f'Configure {hyfetch}'))
|
||||||
parser.add_argument('-p', '--preset', help=f'Use preset', choices=PRESETS.keys())
|
parser.add_argument('-p', '--preset', help=f'Use preset', choices=PRESETS.keys())
|
||||||
parser.add_argument('-m', '--mode', help=f'Color mode', choices=['ansi', '8bit', 'rgb'])
|
parser.add_argument('-m', '--mode', help=f'Color mode', choices=['8bit', 'rgb'])
|
||||||
parser.add_argument('--c-scale', dest='scale', help=f'Lighten colors by a multiplier', type=float)
|
parser.add_argument('--c-scale', dest='scale', help=f'Lighten colors by a multiplier', type=float)
|
||||||
parser.add_argument('--c-set-l', dest='light', help=f'Set lightness value of the colors', type=float)
|
parser.add_argument('--c-set-l', dest='light', help=f'Set lightness value of the colors', type=float)
|
||||||
|
|
||||||
@@ -163,4 +165,4 @@ def run():
|
|||||||
preset = ColorProfile([c.set_light(args.light) for c in preset.colors])
|
preset = ColorProfile([c.set_light(args.light) for c in preset.colors])
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
run_neofetch(preset)
|
run_neofetch(preset, config.mode)
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -6,6 +8,7 @@ from tempfile import TemporaryDirectory
|
|||||||
|
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
|
||||||
|
from .color_util import AnsiMode
|
||||||
from .presets import ColorProfile
|
from .presets import ColorProfile
|
||||||
|
|
||||||
|
|
||||||
@@ -27,7 +30,7 @@ def get_distro_ascii() -> str:
|
|||||||
return check_output([get_command_path(), "print_ascii"]).decode().strip()
|
return check_output([get_command_path(), "print_ascii"]).decode().strip()
|
||||||
|
|
||||||
|
|
||||||
def run_neofetch(preset: ColorProfile):
|
def run_neofetch(preset: ColorProfile, mode: AnsiMode):
|
||||||
# Get existing ascii
|
# Get existing ascii
|
||||||
asc = get_distro_ascii()
|
asc = get_distro_ascii()
|
||||||
|
|
||||||
@@ -37,7 +40,7 @@ def run_neofetch(preset: ColorProfile):
|
|||||||
# Add new colors
|
# Add new colors
|
||||||
lines = asc.split('\n')
|
lines = asc.split('\n')
|
||||||
colors = preset.with_length(len(lines))
|
colors = preset.with_length(len(lines))
|
||||||
asc = '\n'.join([colors[i].to_ansi_rgb() + l for i, l in enumerate(lines)])
|
asc = '\n'.join([colors[i].to_ansi(mode) + l for i, l in enumerate(lines)])
|
||||||
|
|
||||||
# Write temp file
|
# Write temp file
|
||||||
with TemporaryDirectory() as tmp_dir:
|
with TemporaryDirectory() as tmp_dir:
|
||||||
|
|||||||
+127
-3
@@ -1,7 +1,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from typing_extensions import Literal
|
||||||
from typing import Literal, Optional
|
|
||||||
|
|
||||||
from .color_util import RGB
|
from .color_util import RGB
|
||||||
|
|
||||||
@@ -82,7 +81,6 @@ class ColorProfile:
|
|||||||
result += '\033[0m'
|
result += '\033[0m'
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
PRESETS: dict[str, ColorProfile] = {
|
PRESETS: dict[str, ColorProfile] = {
|
||||||
'rainbow': ColorProfile([
|
'rainbow': ColorProfile([
|
||||||
'#E50000',
|
'#E50000',
|
||||||
@@ -158,4 +156,130 @@ PRESETS: dict[str, ColorProfile] = {
|
|||||||
'#ABABAB',
|
'#ABABAB',
|
||||||
'#000000'
|
'#000000'
|
||||||
]),
|
]),
|
||||||
|
# below sourced from https://www.flagcolorcodes.com/flags/pride
|
||||||
|
# goto f"https://www.flagcolorcodes.com/{preset}" for info
|
||||||
|
# todo: sane sorting
|
||||||
|
'autosexual': ColorProfile([
|
||||||
|
'#99D9EA',
|
||||||
|
'#7F7F7F'
|
||||||
|
]),
|
||||||
|
'intergender': ColorProfile([
|
||||||
|
# todo: use weighted spacing
|
||||||
|
'#900DC2',
|
||||||
|
'#900DC2',
|
||||||
|
'#FFE54F',
|
||||||
|
'#900DC2',
|
||||||
|
'#900DC2',
|
||||||
|
]),
|
||||||
|
'greygender': ColorProfile([
|
||||||
|
'#B3B3B3',
|
||||||
|
'#B3B3B3',
|
||||||
|
'#FFFFFF',
|
||||||
|
'#062383',
|
||||||
|
'#062383',
|
||||||
|
'#FFFFFF',
|
||||||
|
'#535353',
|
||||||
|
'#535353',
|
||||||
|
]),
|
||||||
|
'akiosexual': ColorProfile([
|
||||||
|
'#F9485E',
|
||||||
|
'#FEA06A',
|
||||||
|
'#FEF44C',
|
||||||
|
'#FFFFFF',
|
||||||
|
'#000000',
|
||||||
|
]),
|
||||||
|
'transmasculine': ColorProfile([
|
||||||
|
'#FF8ABD',
|
||||||
|
'#CDF5FE',
|
||||||
|
'#9AEBFF',
|
||||||
|
'#74DFFF',
|
||||||
|
'#9AEBFF',
|
||||||
|
'#CDF5FE',
|
||||||
|
'#FF8ABD',
|
||||||
|
]),
|
||||||
|
'demifaun': ColorProfile([
|
||||||
|
'#7F7F7F',
|
||||||
|
'#7F7F7F',
|
||||||
|
'#C6C6C6',
|
||||||
|
'#C6C6C6',
|
||||||
|
'#FCC688',
|
||||||
|
'#FFF19C',
|
||||||
|
'#FFFFFF',
|
||||||
|
'#8DE0D5',
|
||||||
|
'#9682EC',
|
||||||
|
'#C6C6C6',
|
||||||
|
'#C6C6C6',
|
||||||
|
'#7F7F7F',
|
||||||
|
'#7F7F7F',
|
||||||
|
]),
|
||||||
|
'neutrois': ColorProfile([
|
||||||
|
'#FFFFFF',
|
||||||
|
'#1F9F00',
|
||||||
|
'#000000'
|
||||||
|
]),
|
||||||
|
'biromantic alt 2': ColorProfile([
|
||||||
|
'#8869A5',
|
||||||
|
'#D8A7D8',
|
||||||
|
'#FFFFFF',
|
||||||
|
'#FDB18D',
|
||||||
|
'#151638',
|
||||||
|
]),
|
||||||
|
'biromantic alt 2': ColorProfile([
|
||||||
|
'#740194',
|
||||||
|
'#AEB1AA',
|
||||||
|
'#FFFFFF',
|
||||||
|
'#AEB1AA',
|
||||||
|
'#740194',
|
||||||
|
]),
|
||||||
|
'autoromantic': ColorProfile([ # symbol interpreted
|
||||||
|
'#99D9EA',
|
||||||
|
'#99D9EA',
|
||||||
|
'#99D9EA',
|
||||||
|
'#99D9EA',
|
||||||
|
'#99D9EA',
|
||||||
|
'#000000',
|
||||||
|
'#3DA542',
|
||||||
|
'#3DA542',
|
||||||
|
'#000000',
|
||||||
|
'#7F7F7F',
|
||||||
|
'#7F7F7F',
|
||||||
|
'#7F7F7F',
|
||||||
|
'#7F7F7F',
|
||||||
|
'#7F7F7F',
|
||||||
|
]),
|
||||||
|
# i didn't expect this one to work. cool!
|
||||||
|
'boyflux alt 2': ColorProfile([
|
||||||
|
'#E48AE4',
|
||||||
|
'#9A81B4',
|
||||||
|
'#55BFAB',
|
||||||
|
'#FFFFFF',
|
||||||
|
'#A8A8A8',
|
||||||
|
'#81D5EF',
|
||||||
|
'#81D5EF',
|
||||||
|
'#81D5EF',
|
||||||
|
'#81D5EF',
|
||||||
|
'#81D5EF',
|
||||||
|
'#69ABE5',
|
||||||
|
'#69ABE5',
|
||||||
|
'#69ABE5',
|
||||||
|
'#69ABE5',
|
||||||
|
'#69ABE5',
|
||||||
|
'#69ABE5',
|
||||||
|
'#69ABE5',
|
||||||
|
'#69ABE5',
|
||||||
|
'#69ABE5',
|
||||||
|
'#69ABE5',
|
||||||
|
'#5276D4',
|
||||||
|
'#5276D4',
|
||||||
|
'#5276D4',
|
||||||
|
'#5276D4',
|
||||||
|
'#5276D4',
|
||||||
|
'#5276D4',
|
||||||
|
'#5276D4',
|
||||||
|
'#5276D4',
|
||||||
|
'#5276D4',
|
||||||
|
'#5276D4',
|
||||||
|
]),
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3315,7 +3315,7 @@ get_term() {
|
|||||||
name="$(get_process_name "$parent")"
|
name="$(get_process_name "$parent")"
|
||||||
|
|
||||||
case ${name// } in
|
case ${name// } in
|
||||||
"${SHELL/*\/}"|*"sh"|"screen"|"su"*|"newgrp") ;;
|
"${SHELL/*\/}"|*"sh"|"screen"|"su"*|"newgrp"|"hyfetch") ;;
|
||||||
|
|
||||||
"login"*|*"Login"*|"init"|"(init)")
|
"login"*|*"Login"*|"init"|"(init)")
|
||||||
term="$(tty)"
|
term="$(tty)"
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
import hyfetch
|
import hyfetch
|
||||||
from setuptools import setup, find_packages
|
|
||||||
|
|
||||||
# The directory containing this file
|
# The directory containing this file
|
||||||
HERE = pathlib.Path(__file__).parent
|
HERE = pathlib.Path(__file__).parent
|
||||||
@@ -22,13 +24,15 @@ setup(
|
|||||||
classifiers=[
|
classifiers=[
|
||||||
"License :: OSI Approved :: MIT License",
|
"License :: OSI Approved :: MIT License",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
|
"Programming Language :: Python :: 3.7",
|
||||||
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
],
|
],
|
||||||
packages=['hyfetch'],
|
packages=['hyfetch'],
|
||||||
package_data={'hyfetch': ['hyfetch/*']},
|
package_data={'hyfetch': ['hyfetch/*']},
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
install_requires=['hypy_utils==1.0.5'],
|
install_requires=['setuptools', 'hypy_utils>=1.0.6', 'typing_extensions'],
|
||||||
entry_points={
|
entry_points={
|
||||||
"console_scripts": [
|
"console_scripts": [
|
||||||
"hyfetch=hyfetch.main:run",
|
"hyfetch=hyfetch.main:run",
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
|
from hypy_utils import printc
|
||||||
|
|
||||||
from hyfetch.color_util import RGB
|
from hyfetch.color_util import RGB
|
||||||
|
from hyfetch.neofetch_util import get_command_path, run_neofetch
|
||||||
from hyfetch.presets import PRESETS
|
from hyfetch.presets import PRESETS
|
||||||
|
|
||||||
|
|
||||||
@@ -6,10 +9,32 @@ def print_colors_test(colors: list[RGB]):
|
|||||||
print(''.join(f'{c.to_ansi_rgb()}#' for c in colors))
|
print(''.join(f'{c.to_ansi_rgb()}#' for c in colors))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def test_preset_length():
|
||||||
p = PRESETS.get('transgender')
|
p = PRESETS.get('transgender')
|
||||||
print_colors_test(p.with_length(9))
|
print_colors_test(p.with_length(9))
|
||||||
print_colors_test(p.with_length(6))
|
print_colors_test(p.with_length(6))
|
||||||
p = PRESETS.get('nonbinary')
|
p = PRESETS.get('nonbinary')
|
||||||
print_colors_test(p.with_length(7))
|
print_colors_test(p.with_length(7))
|
||||||
print_colors_test(p.with_length(6))
|
print_colors_test(p.with_length(6))
|
||||||
|
|
||||||
|
|
||||||
|
def test_command_path():
|
||||||
|
print(get_command_path())
|
||||||
|
|
||||||
|
|
||||||
|
def test_rgb_8bit_conversion():
|
||||||
|
for r in range(0, 255, 16):
|
||||||
|
for g in range(0, 255, 16):
|
||||||
|
print(RGB(r, g, 0).to_ansi_rgb(False), end=' ')
|
||||||
|
printc('&r')
|
||||||
|
print()
|
||||||
|
for r in range(0, 255, 16):
|
||||||
|
for g in range(0, 255, 16):
|
||||||
|
print(RGB(r, g, 0).to_ansi_8bit(False), end=' ')
|
||||||
|
printc('&r')
|
||||||
|
print()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
test_rgb_8bit_conversion()
|
||||||
|
|||||||
Reference in New Issue
Block a user