From ac9e4c91ec9ffcd9b0f4d3d457d83bde403b1a29 Mon Sep 17 00:00:00 2001 From: Willem Van Onsem Date: Sun, 17 Aug 2025 15:32:16 +0200 Subject: [PATCH 1/3] better dark-light threshold --- src/Data/Hashable/Color.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/Hashable/Color.hs b/src/Data/Hashable/Color.hs index 0ca68fa..38604b2 100644 --- a/src/Data/Hashable/Color.hs +++ b/src/Data/Hashable/Color.hs @@ -55,7 +55,7 @@ _ansiSeqFg = _ansiSeq 38 _altColor :: Col8 -> Col8 _altColor ~(r, g, b) - | 1063 * fromEnum r + 3576 * fromEnum g + 361 * fromEnum b <= 200000 = (255, 255, 255) + | 299 * fromEnum r + 587 * fromEnum g + 114 * fromEnum b <= 128000 = (255, 255, 255) | otherwise = (0, 0, 0) -- | Convert a given 'Hashable' object to a 'Colour' by determining the hash, and using the last 24 bits as source for the red, green, and blue channels of the 'Colour' to construct. From 56dc971cd2403a378d55c8b0f561d937302a6dba Mon Sep 17 00:00:00 2001 From: Willem Van Onsem Date: Sun, 17 Aug 2025 15:33:33 +0200 Subject: [PATCH 2/3] lts-24 --- .github/workflows/build-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index d515a09..95e58aa 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -5,7 +5,7 @@ jobs: linux1: strategy: matrix: - resolver: [lts-12, lts-13, lts-14, lts-15, lts-16, lts-17, lts-18, lts-19, lts-20, lts-21, lts-22, lts-23] + resolver: [lts-12, lts-13, lts-14, lts-15, lts-16, lts-17, lts-18, lts-19, lts-20, lts-21, lts-22, lts-23, lts-24] name: Build the Haskell software runs-on: ubuntu-latest steps: @@ -22,7 +22,7 @@ jobs: linux2: strategy: matrix: - resolver: [lts-12, lts-13, lts-14, lts-15, lts-16, lts-17, lts-18, lts-19, lts-20, lts-21, lts-22, lts-23] + resolver: [lts-12, lts-13, lts-14, lts-15, lts-16, lts-17, lts-18, lts-19, lts-20, lts-21, lts-22, lts-23, lts-24] name: Build the Haddock documentation runs-on: ubuntu-latest steps: @@ -78,7 +78,7 @@ jobs: linux6: strategy: matrix: - resolver: [lts-12, lts-13, lts-14, lts-15, lts-16, lts-17, lts-18, lts-19, lts-20, lts-21, lts-22, lts-23] + resolver: [lts-12, lts-13, lts-14, lts-15, lts-16, lts-17, lts-18, lts-19, lts-20, lts-21, lts-22, lts-23, lts-24] name: Run the tests runs-on: ubuntu-latest steps: From 80342c8e71b1eeb9e2fa48837ed6390e329a2122 Mon Sep 17 00:00:00 2001 From: Willem Van Onsem Date: Sun, 17 Aug 2025 15:35:30 +0200 Subject: [PATCH 3/3] explicit casting --- src/Data/Hashable/Color.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/Hashable/Color.hs b/src/Data/Hashable/Color.hs index 38604b2..39a32ee 100644 --- a/src/Data/Hashable/Color.hs +++ b/src/Data/Hashable/Color.hs @@ -55,7 +55,7 @@ _ansiSeqFg = _ansiSeq 38 _altColor :: Col8 -> Col8 _altColor ~(r, g, b) - | 299 * fromEnum r + 587 * fromEnum g + 114 * fromEnum b <= 128000 = (255, 255, 255) + | 299 * fromEnum r + 587 * fromEnum g + 114 * fromEnum b <= (128000 :: Int) = (255, 255, 255) | otherwise = (0, 0, 0) -- | Convert a given 'Hashable' object to a 'Colour' by determining the hash, and using the last 24 bits as source for the red, green, and blue channels of the 'Colour' to construct.