projects
/
website.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7ef81a5
)
Factored out default color selection in getIndividualColor to eliminate code duplication.
author
sabadev
<saba@sabadev.xyz>
Sun, 21 Mar 2021 04:35:34 +0000
(
00:35
-0400)
committer
sabadev
<dev@sabadev.xyz>
Tue, 13 Apr 2021 01:16:31 +0000
(21:16 -0400)
src/Server.hs
patch
|
blob
|
history
diff --git
a/src/Server.hs
b/src/Server.hs
index
c3d0fbe
..
e2897ee
100644
(file)
--- a/
src/Server.hs
+++ b/
src/Server.hs
@@
-51,5
+51,8
@@
getColorFromInput lightDark redColor greenColor blueColor = do
C.rgba red green blue 1
getIndividualColor :: LightDark -> Maybe Integer -> Integer
-getIndividualColor Dark value = flip mod 0x100 $ fromMaybe 0x00 value
-getIndividualColor Light value = flip mod 0x100 $ fromMaybe 0xFF value
+getIndividualColor color = flip mod 0x100 . fromMaybe (defaultColor color)
+
+defaultColor :: LightDark -> Integer
+defaultColor Dark = 0x00
+defaultColor Light = 0xFF