1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-28 23:44:51 +09:00

Define color palette and write initial Cassius

This commit is contained in:
fr33domlover 2016-02-18 22:33:27 +00:00
parent ab98930caa
commit ee7a353904
3 changed files with 80 additions and 1 deletions

View file

@ -16,6 +16,7 @@
module Import.NoFoundation ( module Import ) where module Import.NoFoundation ( module Import ) where
import ClassyPrelude.Yesod as Import import ClassyPrelude.Yesod as Import
import Style as Import
import Model as Import import Model as Import
import Settings as Import import Settings as Import
import Settings.StaticFiles as Import import Settings.StaticFiles as Import

View file

@ -22,6 +22,7 @@ module Style
-- * Plain Colors -- * Plain Colors
, black , black
, white , white
, plain
-- * Color Hues -- * Color Hues
, red , red
, green , green
@ -36,6 +37,12 @@ module Style
) )
where where
import Prelude
import Text.Cassius (ToCss (..))
import qualified Text.Cassius as C (Color (Color))
data Lightness = Light | Dark data Lightness = Light | Dark
data Color data Color
@ -48,12 +55,36 @@ data Color
| Cyan Lightness | Cyan Lightness
| Gray Lightness | Gray Lightness
| White | White
| PlainText
instance ToCss Color where
toCss col =
let c r g b = toCss $ C.Color r g b
in case col of
Black -> c 0x00 0x00 0x00
Red Dark -> c 0xCC 0x00 0x00
Red Light -> c 0xEF 0x29 0x29
Green Dark -> c 0x4E 0x9A 0x06
Green Light -> c 0x8A 0xE2 0x34
Yellow Dark -> c 0xC4 0xA0 0x00
Yellow Light -> c 0xFC 0xE9 0x4F
Blue Dark -> c 0x34 0x65 0xA4
Blue Light -> c 0x73 0x9F 0xCF
Magenta Dark -> c 0x75 0x50 0x7B
Magenta Light -> c 0xAD 0x7F 0xA8
Cyan Dark -> c 0x06 0x98 0x9A
Cyan Light -> c 0x34 0xE2 0xE2
Gray Dark -> c 0x55 0x57 0x53
Gray Light -> c 0xD3 0xD7 0xCF
White -> c 0xEE 0xEE 0xEC
PlainText -> c 0xCC 0xCC 0xCC
newtype Hue = Hue (Lightness -> Color) newtype Hue = Hue (Lightness -> Color)
black, white :: Color black, white, plain :: Color
black = Black black = Black
white = White white = White
plain = PlainText
red, green, yellow, blue, magenta, cyan, gray :: Hue red, green, yellow, blue, magenta, cyan, gray :: Hue
red = Hue Red red = Hue Red

View file

@ -0,0 +1,47 @@
/* This file is part of Vervis.
*
* Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
*
* ♡ Copying is an act of love. Please copy, reuse and share.
*
* The author(s) have dedicated all copyright and related and neighboring
* rights to this software to the public domain worldwide. This software is
* distributed without any warranty.
*
* You should have received a copy of the CC0 Public Domain Dedication along
* with this software. If not, see
* <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
body
font-family: sans-serif
line-height: 1.4
color: #{plain}
background: #{black}
a
color: #{light blue}
h1
color: #{dark yellow}
font: 160% monospace
h2
color: #{dark yellow}
font: 140% monospace
h3
color: #{dark yellow}
font: 120% monospace
h4
color: #{dark yellow}
font: bold 100% monospace
h5
color: #{dark yellow}
font: bold 80% monospace
h6
color: #{dark yellow}
font: bold 80% monospace