charmbracelet / lipgloss

Style definitions for nice terminal layouts 👄
MIT License
8.21k stars 229 forks source link

(v2) fix: restore lipgloss.Color behavior #441

Closed aymanbagabas closed 3 days ago

aymanbagabas commented 4 days ago

The new behavior of lipgloss.Color taking any type is ambiguous and can lead to unexpected results. This commit restores the original behavior of lipgloss.Color taking a hex string or an int string, and returning a color.Color.

To use a 4-bit color, use lipgloss.Red, lipgloss.Blue, etc. To use a 16-bit color, use lipgloss.ANSIColor. To use a 24-bit color, use lipgloss.Color, lipgloss.RGBColor, or any other color.Color value.

Fixes: https://github.com/charmbracelet/lipgloss/pull/437