4import CSS (ColorSpace(..), blue, brightness, contrast, darken, desaturate, isLight, lighten, mix, rotateHue, toHexString)
6import Data.Foldable (intercalate)
7import Data.Symbol (SProxy(..))
8import Record.Builder as RB
9import Theme.Types (Theme, CSSTheme)
11increaseContrast ∷ Color -> Color -> Color
12increaseContrast contrastWith = go 0
14 modify = if isLight contrastWith then darken else lighten
17 if contrast contrastWith col >= 7.5 || i >= 20 then
20 go (i + 1) (modify 0.1 col)
22f ∷ ∀ fieldName. SProxy fieldName
25fromTheme ∷ Theme -> CSSTheme
29 RB.modify (f ∷ _ "backgroundColour") toHexString
30 >>> RB.insert (f ∷ _ "backgroundColourLighter")
31 (theme.backgroundColour # lighter >>> toHexString)
32 >>> RB.modify (f ∷ _ "interfaceColour") toHexString
33 >>> RB.insert (f ∷ _ "interfaceColourLighter")
34 (theme.interfaceColour # lighter >>> toHexString)
35 >>> RB.insert (f ∷ _ "interfaceColourLightest")
36 (theme.interfaceColour # lighter >>> lighter >>> toHexString)
37 >>> RB.insert (f ∷ _ "interfaceColourDarker")
38 (theme.interfaceColour # darker >>> toHexString)
39 >>> RB.insert (f ∷ _ "interfaceColourDarkest")
40 (theme.interfaceColour # darker >>> darker >>> toHexString)
43 >>> RB.modify (f ∷ _ "textColour") toHexString
44 >>> RB.insert (f ∷ _ "textColourLighter")
45 (theme.textColour # lighter >>> toHexString)
46 >>> RB.insert (f ∷ _ "textColourLightest")
47 (theme.textColour # lighter >>> lighter >>> toHexString)
48 >>> RB.insert (f ∷ _ "textColourDarker")
49 (theme.textColour # darker >>> toHexString)
50 >>> RB.insert (f ∷ _ "textColourDarkest")
51 (theme.textColour # darker >>> darker >>> toHexString)
54 >>> RB.modify (f ∷ _ "highlightColour") toHexString
55 >>> RB.insert (f ∷ _ "highlightColourDark")
56 (theme.highlightColour # darken 0.2 # rotateHue (-10.0) # toHexString)
59 >>> RB.modify (f ∷ _ "altHighlightColour") toHexString
60 >>> RB.insert (f ∷ _ "altHighlightColourDark")
61 (theme.altHighlightColour # darken 0.2 # toHexString)
64 >>> RB.modify (f ∷ _ "yellow") toHexString
65 >>> RB.modify (f ∷ _ "green") toHexString
66 >>> RB.modify (f ∷ _ "pink") toHexString
67 >>> RB.modify (f ∷ _ "orange") toHexString
68 >>> RB.modify (f ∷ _ "turquoise") toHexString
69 >>> RB.modify (f ∷ _ "red") toHexString
70 >>> RB.modify (f ∷ _ "blue") toHexString
73 >>> RB.modify (f ∷ _ "textFontFamily") (intercalate ",")
74 >>> RB.modify (f ∷ _ "headingFontFamily") (intercalate ",")
75 >>> RB.insert (f ∷ _ "isLight") isLightTheme
79 isLightTheme = isLight theme.backgroundColour
81 yellower ∷ Color -> Color
83 if brightness col > 0.8 then
95 lighter ∷ Color -> Color
98 darker ∷ Color -> Color
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list