diff --git a/.gitignore b/.gitignore index 7dbfd92..26b0a26 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ !*.go !*.md !*.mod -!*.sum +!*.sum \ No newline at end of file diff --git a/Color.go b/Color.go index 5b007c9..2ea19f8 100644 --- a/Color.go +++ b/Color.go @@ -39,4 +39,4 @@ func (c Color) Println(args ...any) { } fmt.Printf("\x1b[38;2;%d;%d;%dm%s\n\x1b[0m", c.R, c.G, c.B, fmt.Sprint(args...)) -} +} \ No newline at end of file diff --git a/Color_test.go b/Color_test.go index 1abfa15..7979032 100644 --- a/Color_test.go +++ b/Color_test.go @@ -52,4 +52,4 @@ func TestPrintln(t *testing.T) { color.RGB(1, 0, 0).Println("red") color.RGB(0, 1, 0).Println("green") color.RGB(0, 0, 1).Println("blue") -} +} \ No newline at end of file diff --git a/HSL.go b/HSL.go index f5cda9a..867eee0 100644 --- a/HSL.go +++ b/HSL.go @@ -26,4 +26,4 @@ func HSL(hue Value, saturation Value, lightness Value) Color { m := lightness - c/2 return RGB(r+m, g+m, b+m) -} +} \ No newline at end of file diff --git a/HSL_test.go b/HSL_test.go index 0c3e654..6eec2c9 100644 --- a/HSL_test.go +++ b/HSL_test.go @@ -23,4 +23,4 @@ func TestHSLSpectrum(t *testing.T) { fmt.Println() } -} +} \ No newline at end of file diff --git a/HSV.go b/HSV.go index 2efa5fd..9e375e7 100644 --- a/HSV.go +++ b/HSV.go @@ -26,4 +26,4 @@ func HSV(hue Value, saturation Value, value Value) Color { m := value - c return RGB(r+m, g+m, b+m) -} +} \ No newline at end of file diff --git a/HSV_test.go b/HSV_test.go index c2b4bd3..643baf0 100644 --- a/HSV_test.go +++ b/HSV_test.go @@ -23,4 +23,4 @@ func TestHSVSpectrum(t *testing.T) { fmt.Println() } -} +} \ No newline at end of file diff --git a/LCH.go b/LCH.go index c27d4df..054de9c 100644 --- a/LCH.go +++ b/LCH.go @@ -57,4 +57,4 @@ func oklabToLinearRGB(lightness Value, a Value, b Value) (Value, Value, Value) { blue := -0.0041960863*l - 0.7034186147*m + 1.7076147010*s return red, green, blue -} +} \ No newline at end of file diff --git a/LCH_test.go b/LCH_test.go index 59e9097..53c0e72 100644 --- a/LCH_test.go +++ b/LCH_test.go @@ -48,4 +48,4 @@ func TestLCHSpectrum(t *testing.T) { fmt.Println() } -} +} \ No newline at end of file diff --git a/RGB.go b/RGB.go index 3d94abc..0539cbd 100644 --- a/RGB.go +++ b/RGB.go @@ -33,4 +33,4 @@ func sRGB(x Value) Value { } return 1.0 -} +} \ No newline at end of file diff --git a/RGB_test.go b/RGB_test.go index a1f4481..569a2db 100644 --- a/RGB_test.go +++ b/RGB_test.go @@ -26,4 +26,4 @@ func TestRGB(t *testing.T) { for name, c := range rgbColors { c.Println("█ " + name) } -} +} \ No newline at end of file diff --git a/Terminal.go b/Terminal.go index e47cf17..575940d 100644 --- a/Terminal.go +++ b/Terminal.go @@ -10,4 +10,4 @@ import ( var Terminal = tty.IsTerminal(os.Stdout.Fd()) // TrueColor indicates if the terminal has 24-bit color support. -var TrueColor = os.Getenv("COLORTERM") == "truecolor" +var TrueColor = os.Getenv("COLORTERM") == "truecolor" \ No newline at end of file diff --git a/Value.go b/Value.go index 42635f1..808e410 100644 --- a/Value.go +++ b/Value.go @@ -1,4 +1,4 @@ package color // Value is a type definition for the data type of a single color component. -type Value = float64 +type Value = float64 \ No newline at end of file diff --git a/ansi/Code.go b/ansi/Code.go index 46c68bd..896857f 100644 --- a/ansi/Code.go +++ b/ansi/Code.go @@ -37,4 +37,4 @@ func (code Code) Println(args ...any) { } fmt.Printf("\x1b[%dm%s\n\x1b[0m", code, fmt.Sprint(args...)) -} +} \ No newline at end of file diff --git a/ansi/Code_test.go b/ansi/Code_test.go index 64a1f47..e7f5311 100644 --- a/ansi/Code_test.go +++ b/ansi/Code_test.go @@ -52,4 +52,4 @@ func testPrintln() { ansi.Yellow.Println("Yellow") ansi.Magenta.Println("Magenta") ansi.Cyan.Println("Cyan") -} +} \ No newline at end of file diff --git a/ansi/Color.go b/ansi/Color.go index 65bacda..b06e991 100644 --- a/ansi/Color.go +++ b/ansi/Color.go @@ -9,4 +9,4 @@ const ( Magenta Cyan White -) +) \ No newline at end of file diff --git a/ansi/Format.go b/ansi/Format.go index 29bfcf6..2876cd0 100644 --- a/ansi/Format.go +++ b/ansi/Format.go @@ -11,4 +11,4 @@ const ( Reverse Hidden Strikethrough -) +) \ No newline at end of file diff --git a/Benchmarks_test.go b/bench_test.go similarity index 99% rename from Benchmarks_test.go rename to bench_test.go index c811429..d5c215d 100644 --- a/Benchmarks_test.go +++ b/bench_test.go @@ -34,4 +34,4 @@ func BenchmarkPrintRaw(b *testing.B) { for b.Loop() { c.Print("") } -} +} \ No newline at end of file diff --git a/go.mod b/go.mod index c3152ec..61c2d73 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module git.urbach.dev/go/color go 1.24 -require golang.org/x/sys v0.31.0 +require golang.org/x/sys v0.31.0 \ No newline at end of file diff --git a/go.sum b/go.sum index c55261f..cfac067 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= \ No newline at end of file diff --git a/README.md b/readme.md similarity index 100% rename from README.md rename to readme.md diff --git a/tty/Terminal_bsd.go b/tty/Terminal_bsd.go index 15e06e0..5579b86 100644 --- a/tty/Terminal_bsd.go +++ b/tty/Terminal_bsd.go @@ -8,4 +8,4 @@ import "golang.org/x/sys/unix" func IsTerminal(fd uintptr) bool { _, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA) return err == nil -} +} \ No newline at end of file diff --git a/tty/Terminal_linux.go b/tty/Terminal_linux.go index 023c564..8e74a33 100644 --- a/tty/Terminal_linux.go +++ b/tty/Terminal_linux.go @@ -8,4 +8,4 @@ import "golang.org/x/sys/unix" func IsTerminal(fd uintptr) bool { _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) return err == nil -} +} \ No newline at end of file diff --git a/tty/Terminal_other.go b/tty/Terminal_other.go index 3ea5ee8..3e34252 100644 --- a/tty/Terminal_other.go +++ b/tty/Terminal_other.go @@ -5,4 +5,4 @@ package tty // IsTerminal is always false on unsupported platforms. func IsTerminal(fd uintptr) bool { return false -} +} \ No newline at end of file diff --git a/tty/Terminal_test.go b/tty/Terminal_test.go index 1f1a097..bbce9d1 100644 --- a/tty/Terminal_test.go +++ b/tty/Terminal_test.go @@ -9,4 +9,4 @@ import ( func TestIsTerminal(t *testing.T) { tty.IsTerminal(os.Stdout.Fd()) -} +} \ No newline at end of file diff --git a/tty/Terminal_windows.go b/tty/Terminal_windows.go index 0bf1927..6786198 100644 --- a/tty/Terminal_windows.go +++ b/tty/Terminal_windows.go @@ -9,4 +9,4 @@ func IsTerminal(fd uintptr) bool { var mode uint32 err := windows.GetConsoleMode(windows.Handle(fd), &mode) return err == nil -} +} \ No newline at end of file