Skip to content

Commit 4258666

Browse files
committed
fix: Update Tailwind color references in documentation and examples
- Standardized Tailwind color references by removing colons in color names (e.g., changed `tw.blue:500` to `tw.blue500`). - Updated multiple documentation files, examples, and notebooks to reflect the new color format for consistency. - Ensured all color references are accurate and aligned with the latest color system specifications.
1 parent 09105bd commit 4258666

File tree

18 files changed

+330
-338
lines changed

18 files changed

+330
-338
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ dm.style.use_preset('scientific-kr')
6363

6464
### Color System
6565
- **dartwork-mpl Colors**: Custom color palette with `oc.red5`, `oc.blue2`, etc.
66-
- **Tailwind CSS Integration**: Full Tailwind palette with `tw.blue:500`, `tailwind.gray:200`, etc.
66+
- **Tailwind CSS Integration**: Full Tailwind palette with `tw.blue500`, `tw.gray200`, etc.
6767
- **Color Utilities**: Mix colors and apply pseudo-transparency
6868

6969
### Layout & Utilities
@@ -102,7 +102,7 @@ ax = fig.add_subplot(gs[0, 0])
102102
# Plot with custom colors
103103
x = np.linspace(0, 10, 100)
104104
ax.plot(x, np.sin(x), c='oc.red5', lw=0.7, label='Sin')
105-
ax.plot(x, np.cos(x), c='tw.blue:500', lw=0.7, label='Cos')
105+
ax.plot(x, np.cos(x), c='tw.blue500', lw=0.7, label='Cos')
106106

107107
# Customize
108108
ax.set_xlabel('X value')

docs/api/color.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Color Utilities
33

44
Importing ``dartwork_mpl`` registers a large catalog of named colors with
55
matplotlib (``oc.*`` plus Tailwind ``tw.``, Material ``md.``, Ant Design
6-
``ant.``, Chakra ``chakra.``, and Primer ``primer.`` prefixes). These helpers
6+
``ad.``, Chakra ``cu.``, and Primer ``pr.`` prefixes). These helpers
77
expose the color mixing routines used across the package and let you classify
88
colormaps before plotting. Each helper lists its parameters and return value
99
before jumping into examples.

docs/color_system/colors.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ below is full-width so the swatch labels stay readable on both desktop and
55
mobile.
66

77
## How to read the labels
8-
- Format: `library.base:weight` (`tw.blue:500`, `md.red:700`, `opencolor.gray:6`).
8+
- Format: `library.base:weight` (`tw.blue500`, `md.red700`, `oc.gray6`).
99
- Works anywhere matplotlib accepts a color—no extra API layer required.
1010
- `dm.use()` loads the dartwork style so these names look consistent across
1111
lines, fills, markers, and legends.
@@ -17,8 +17,8 @@ import numpy as np
1717

1818
dm.use()
1919
t = np.linspace(0, 2 * np.pi, 200)
20-
plt.plot(t, np.sin(t), color="opencolor.indigo:6", linewidth=2.4, label="Indigo 6")
21-
plt.scatter(t[::12], np.cos(t[::12]), color="tw.rose:500", edgecolor="none")
20+
plt.plot(t, np.sin(t), color="oc.indigo6", linewidth=2.4, label="Indigo 6")
21+
plt.scatter(t[::12], np.cos(t[::12]), color="tw.rose500", edgecolor="none")
2222
plt.legend()
2323
plt.show()
2424
```

docs/color_system/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Color Space <space>
1919
:width: 100%
2020

2121
**Colors.** All named palettes ship as weight-aware labels you can drop straight
22-
into matplotlib (`tw.blue:500`, `md.red:700`, `opencolor.gray:6`, and more).
22+
into matplotlib (`tw.blue500`, `md.red700`, `oc.gray6`, and more).
2323
Every sheet uses generous spacing so labels stay legible.
2424
[Open the full color sheets →](colors.md)
2525
:::
@@ -45,7 +45,7 @@ dm.use() # style + fonts
4545
x = np.linspace(0, 10, 200)
4646
signal = np.sin(x) * np.exp(-0.08 * x)
4747

48-
plt.plot(x, signal, color="tw.emerald:500", linewidth=2.6, label="Emerald 500")
48+
plt.plot(x, signal, color="tw.emerald500", linewidth=2.6, label="Emerald 500")
4949
plt.imshow(np.outer(signal, signal), cmap="dm.sunset")
5050
plt.colorbar(label="normalized response")
5151
plt.legend()

docs/color_system/space.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ import dartwork_mpl as dm
7373
# Works with any matplotlib color name
7474
color1 = dm.named("red")
7575
color2 = dm.named("oc.blue5") # dartwork-mpl colors
76-
color3 = dm.named("tw.blue:500") # Tailwind colors
76+
color3 = dm.named("tw.blue500") # Tailwind colors
7777
```
7878

7979
:::{figure} images/color_space_creation.png

docs/examples_source/bar_charts/plot_bar_chart.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
ax = fig.add_subplot(gs[0, 0])
2626

2727
# Plotting with Tailwind colors
28-
rects1 = ax.bar(x - width / 2, men_means, width, label="Men", color="tw.sky:500")
29-
rects2 = ax.bar(x + width / 2, women_means, width, label="Women", color="tw.rose:500")
28+
rects1 = ax.bar(x - width / 2, men_means, width, label="Men", color="tw.sky500")
29+
rects2 = ax.bar(x + width / 2, women_means, width, label="Women", color="tw.rose500")
3030

3131
# Add some text for labels, title and custom x-axis tick labels, etc.
3232
ax.set_ylabel("Scores", fontsize=dm.fs(0))

docs/examples_source/basic_plots/plot_multiple_lines.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575

7676
# Panel C: Tailwind CSS colors
7777
ax3 = fig.add_subplot(gs[1, 0])
78-
ax3.plot(x, y1, color="tw.red:500", lw=0.7, label="Red")
79-
ax3.plot(x, y2, color="tw.blue:500", lw=0.7, label="Blue")
80-
ax3.plot(x, y3, color="tw.green:500", lw=0.7, label="Green")
81-
ax3.plot(x, y4, color="tw.purple:500", lw=0.7, label="Purple")
78+
ax3.plot(x, y1, color="tw.red500", lw=0.7, label="Red")
79+
ax3.plot(x, y2, color="tw.blue500", lw=0.7, label="Blue")
80+
ax3.plot(x, y3, color="tw.green500", lw=0.7, label="Green")
81+
ax3.plot(x, y4, color="tw.purple500", lw=0.7, label="Purple")
8282
ax3.set_xlabel("X value", fontsize=dm.fs(0))
8383
ax3.set_ylabel("Y value", fontsize=dm.fs(0))
8484
ax3.set_title("Tailwind CSS Colors", fontsize=dm.fs(1))

docs/examples_source/colors_images/plot_color_cycles.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@
5353
ax3 = fig.add_subplot(gs[1, 0])
5454
tw_cycle = cycler(
5555
color=[
56-
"tw.red:500",
57-
"tw.orange:500",
58-
"tw.yellow:600",
59-
"tw.green:500",
60-
"tw.blue:500",
61-
"tw.purple:500",
56+
"tw.red500",
57+
"tw.orange500",
58+
"tw.yellow600",
59+
"tw.green500",
60+
"tw.blue500",
61+
"tw.purple500",
6262
]
6363
)
6464
ax3.set_prop_cycle(tw_cycle)

docs/examples_source/colors_images/plot_colors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
ax.plot(x, np.sin(x), color="oc.red5", lw=2, label="oc.red5")
2424
ax.plot(x, np.cos(x), color="oc.blue5", lw=2, label="oc.blue5")
2525

26-
# 2. Tailwind CSS colors (tw.* or tailwind.*)
27-
ax.plot(x, np.sin(x) + 2, color="tw.green:500", lw=2, label="tw.green:500")
28-
ax.plot(x, np.cos(x) + 2, color="tw.purple:500", lw=2, label="tw.purple:500")
26+
# 2. Tailwind CSS colors (tw.* or tw.*)
27+
ax.plot(x, np.sin(x) + 2, color="tw.green500", lw=2, label="tw.green500")
28+
ax.plot(x, np.cos(x) + 2, color="tw.purple500", lw=2, label="tw.purple500")
2929

3030
# 3. Color mixing
3131
# Mix red and blue

docs/examples_source/layout_styling/plot_layout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
ax2.set_xlabel("X", fontsize=dm.fs(0))
3232
ax2.set_ylabel("Y", fontsize=dm.fs(0))
3333

34-
ax3.plot([1, 2, 3], [1, 1, 1], color="tw.green:500", lw=0.7)
34+
ax3.plot([1, 2, 3], [1, 1, 1], color="tw.green500", lw=0.7)
3535
ax3.set_title("Subplot 3 (Wide)", fontsize=dm.fs(1))
3636
ax3.set_xlabel("X", fontsize=dm.fs(0))
3737
ax3.set_ylabel("Y", fontsize=dm.fs(0))

0 commit comments

Comments
 (0)