5import CSS (ColorSpace(..), blue, brightness, contrast, darken, desaturate, isLight, lighten, mix, rotateHue, toHexString)
7import Data.Foldable (intercalate)
8import Data.Symbol (SProxy(..))
9import Record.Builder as RB
10import Theme.Types (Theme, CSSTheme)
12increaseContrast ∷ Color -> Color -> Color
13increaseContrast contrastWith = go 0
15 modify = if isLight contrastWith then darken else lighten
17 = if contrast contrastWith col >= 7.5 || i >= 20
19 else go (i+1) (modify 0.1 col)
22f ∷ ∀ fieldName. SProxy fieldName
25fromTheme ∷ Theme -> CSSTheme
26fromTheme theme = RB.build (
28 RB.modify (f ∷ _ "backgroundColour") toHexString
29 >>> RB.insert (f ∷ _ "backgroundColourLighter")
30 (theme.backgroundColour # lighter >>> toHexString)
31 >>> RB.modify (f ∷ _ "interfaceColour") toHexString
32 >>> RB.insert (f ∷ _ "interfaceColourLighter")
33 (theme.interfaceColour # lighter >>> toHexString)
34 >>> RB.insert (f ∷ _ "interfaceColourLightest")
35 (theme.interfaceColour # lighter >>> lighter >>> toHexString)
36 >>> RB.insert (f ∷ _ "interfaceColourDarker")
37 (theme.interfaceColour # darker >>> toHexString)
38 >>> RB.insert (f ∷ _ "interfaceColourDarkest")
39 (theme.interfaceColour # darker >>> darker >>> toHexString)
41 >>> RB.modify (f ∷ _ "textColour") toHexString
42 >>> RB.insert (f ∷ _ "textColourLighter")
43 (theme.textColour # lighter >>> toHexString)
44 >>> RB.insert (f ∷ _ "textColourLightest")
45 (theme.textColour # lighter >>> lighter >>> toHexString)
46 >>> RB.insert (f ∷ _ "textColourDarker")
47 (theme.textColour # darker >>> toHexString)
48 >>> RB.insert (f ∷ _ "textColourDarkest")
49 (theme.textColour # darker >>> darker >>> toHexString)
51 >>> RB.modify (f ∷ _ "highlightColour") toHexString
52 >>> RB.insert (f ∷ _ "highlightColourDark")
53 (theme.highlightColour # darken 0.2 # rotateHue (-10.0) # toHexString)
55 >>> RB.modify (f ∷ _ "altHighlightColour") toHexString
56 >>> RB.insert (f ∷ _ "altHighlightColourDark")
57 (theme.altHighlightColour # darken 0.2 # toHexString)
59 >>> RB.modify (f ∷ _ "yellow") toHexString
60 >>> RB.modify (f ∷ _ "green") toHexString
61 >>> RB.modify (f ∷ _ "pink") toHexString
62 >>> RB.modify (f ∷ _ "orange") toHexString
63 >>> RB.modify (f ∷ _ "turquoise") toHexString
64 >>> RB.modify (f ∷ _ "red") toHexString
65 >>> RB.modify (f ∷ _ "blue") toHexString
67 >>> RB.modify (f ∷ _ "textFontFamily") (intercalate ",")
68 >>> RB.modify (f ∷ _ "headingFontFamily") (intercalate ",")
69 >>> RB.insert (f ∷ _ "isLight") isLightTheme
72 isLightTheme = isLight theme.backgroundColour
73 yellower ∷ Color -> Color
75 if brightness col > 0.8
88 lighter ∷ Color -> Color
91 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