Skip to content

Commit d343149

Browse files
Kasper JungeRalphify
authored andcommitted
refactor: extract brand colors into shared _brand module
Brand color constants were defined as private names in _console_emitter.py but imported across module boundaries into cli.py, breaking the private naming convention. Move them to a dedicated _brand.py module so both consumers import from a shared, public location. Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent 87055ab commit d343149

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

src/ralphify/_brand.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"""Brand color constants shared across CLI and console rendering."""
2+
3+
PURPLE = "#A78BF5"
4+
VIOLET = "#8B6CF0"
5+
LAVENDER = "#D4A0E0"
6+
PEACH = "#E8956B"
7+
ORANGE = "#E87B4A"
8+
DEEP_ORANGE = "#E06030"

src/ralphify/_console_emitter.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,9 @@
2929
RunStartedData,
3030
RunStoppedData,
3131
)
32+
from ralphify._brand import PURPLE as _BRAND_PURPLE
3233
from ralphify._output import format_duration
3334

34-
_BRAND_PURPLE = "#A78BF5"
35-
_BRAND_VIOLET = "#8B6CF0"
36-
_BRAND_LAVENDER = "#D4A0E0"
37-
_BRAND_PEACH = "#E8956B"
38-
_BRAND_ORANGE = "#E87B4A"
39-
_BRAND_DEEP_ORANGE = "#E06030"
40-
4135
_ICON_SUCCESS = "✓"
4236
_ICON_FAILURE = "✗"
4337
_ICON_TIMEOUT = "⏱"

src/ralphify/cli.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
from rich.console import Console
2121

2222
from ralphify import __version__
23-
from ralphify._console_emitter import (
24-
_BRAND_DEEP_ORANGE,
25-
_BRAND_LAVENDER,
26-
_BRAND_ORANGE,
27-
_BRAND_PEACH,
28-
_BRAND_PURPLE,
29-
_BRAND_VIOLET,
30-
ConsoleEmitter,
23+
from ralphify._brand import (
24+
DEEP_ORANGE as _BRAND_DEEP_ORANGE,
25+
LAVENDER as _BRAND_LAVENDER,
26+
ORANGE as _BRAND_ORANGE,
27+
PEACH as _BRAND_PEACH,
28+
PURPLE as _BRAND_PURPLE,
29+
VIOLET as _BRAND_VIOLET,
3130
)
31+
from ralphify._console_emitter import ConsoleEmitter
3232
from ralphify._frontmatter import (
3333
CMD_FIELD_NAME,
3434
CMD_FIELD_RUN,

0 commit comments

Comments
 (0)