summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateuszKowalczyk <>2013-12-13 07:34:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2013-12-13 07:34:00 (GMT)
commit306028b6771474e96693c59aecc33b28b7e10407 (patch)
tree5a59c820b266ca93d7a48e1cda74d948fbcbe94b
version 0.1.0.00.1.0.0
-rw-r--r--LICENSE27
-rw-r--r--README.md8
-rw-r--r--Setup.hs2
-rw-r--r--src/Yi/Style/Monokai.hs144
-rw-r--r--yi-monokai.cabal19
5 files changed, 200 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..c84f7ce
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2013, Mateusz Kowalczyk
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice, this
+ list of conditions and the following disclaimer in the documentation and/or
+ other materials provided with the distribution.
+
+* Neither the name of the {organization} nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..ec185df
--- /dev/null
+++ b/README.md
@@ -0,0 +1,8 @@
+yi-monokai
+==========
+
+Monokai colour scheme for the Yi editor, at least for the Pango
+back-end.
+
+Currently looks like
+![yi-monokai](http://fuuzetsu.co.uk/images/monokai-0.1.png "monokai in yi")
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
index 0000000..9a994af
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/src/Yi/Style/Monokai.hs b/src/Yi/Style/Monokai.hs
new file mode 100644
index 0000000..deeb83c
--- /dev/null
+++ b/src/Yi/Style/Monokai.hs
@@ -0,0 +1,144 @@
+-- |
+-- Module : Yi.Style.Monokai
+-- Copyright : (c) Mateusz Kowalczyk 2013
+-- License : BSD3
+--
+-- Maintainer : fuuzetsu@fuuzetsu.co.uk
+-- Stability : experimental
+-- Portability : portable
+
+module Yi.Style.Monokai
+ ( monokaiTheme
+
+ -- * Colours
+ , monokaiYellowLight
+ , monokaiYellowDark
+ , monokaiYellow
+ , monokaiPurpleLight
+ , monokaiMagenta
+ , monokaiGreyDark
+ , monokaiGreen
+ , monokaiGreyLight
+ , monokaiGreyLightest
+ , monokaiGreyDarkest
+ , monokaiGrey
+ , monokaiGreyDarker
+ , monokaiBlueLight
+ , monokaiPurple
+ , monokaiGreenLight
+ )
+ where
+
+import Data.Bits (shiftR)
+import Data.Monoid (mappend)
+import Data.Word (Word32)
+import Yi
+
+-- | The main theme specification. An example use in your @yi.hs@ might
+-- look something like
+--
+-- @
+-- main :: IO ()
+-- main = yi $ myConfig {
+-- defaultKm = defaultKm myConfig
+-- , startFrontEnd = start
+-- , configUI = (configUI defaultConfig) { configTheme = monokaiTheme }
+-- }
+-- @
+monokaiTheme :: Proto UIStyle
+monokaiTheme = defaultTheme `override` \sets _ -> sets
+ { baseAttributes = emptyAttributes { foreground = monokaiYellowLight
+ , background = monokaiGreyDark
+ , reverseAttr = False}
+ , modelineAttributes = emptyAttributes { foreground = monokaiGreyLight
+ , background = monokaiGreyLightest
+ , reverseAttr = False }
+ , selectedStyle = withBg monokaiGreyDarker
+ , hintStyle = withBg monokaiGreyLightest
+ , builtinStyle = withFg monokaiGreen
+ , commentStyle = withFg monokaiYellowDark
+ -- constantStyle would be great…
+ -- no docstringStyle either?
+
+ -- I hope variableStyle covers functions functions
+ -- , variableStyle = withFg monokaiGreenLight -- monokaiMagenta
+ , keywordStyle = withFg monokaiMagenta
+ , stringStyle = withFg monokaiYellow
+ , typeStyle = withFg monokaiBlueLight
+ -- use error style for warnings
+ , errorStyle = withFg monokaiPurpleLight `mappend` withBd True
+
+ , operatorStyle = withFg monokaiMagenta
+
+ , importStyle = withFg monokaiMagenta
+ -- , preprocessorStyle = withFg preproc
+
+ }
+
+
+-- | Convenience function
+rgb :: Word32 -> Color
+rgb x = RGB (fi (x `shiftR` 16))
+ (fi (x `shiftR` 8))
+ (fi x)
+ where
+ fi = fromIntegral
+
+-- | Hex value: 0x89BDFF
+monokaiBlueLight :: Color
+monokaiBlueLight = rgb 0x89BDFF
+-- | Hex value: 0x595959
+monokaiGrey :: Color
+monokaiGrey = rgb 0x595959
+
+-- | Hex value: 0x383830
+monokaiGreyDarker :: Color
+monokaiGreyDarker = rgb 0x383830
+
+-- | Hex value: 0x141411
+monokaiGreyDarkest :: Color
+monokaiGreyDarkest = rgb 0x141411
+
+-- | Hex value: 0x595959
+monokaiGreyLightest :: Color
+monokaiGreyLightest = rgb 0x595959
+
+-- | Hex value: 0xE6E6E6
+monokaiGreyLight :: Color
+monokaiGreyLight = rgb 0xE6E6E6
+
+-- | Hex value: 0xA6E22A
+monokaiGreen :: Color
+monokaiGreen = rgb 0xA6E22A
+
+-- | Hex value: 0xA6E22E
+monokaiGreenLight :: Color
+monokaiGreenLight = rgb 0xA6E22E
+
+-- | Hex value: 0x272822
+monokaiGreyDark :: Color
+monokaiGreyDark = rgb 0x272822
+
+-- | Hex value: 0xF92672
+monokaiMagenta :: Color
+monokaiMagenta = rgb 0xF92672
+
+-- | Hex value: 0xAE81FF
+monokaiPurple :: Color
+monokaiPurple = rgb 0xAE81FF
+
+-- | Hex value: 0xFD5FF1
+monokaiPurpleLight :: Color
+monokaiPurpleLight = rgb 0xFD5FF1
+
+-- | Hex value: 0xE6DB74
+monokaiYellow :: Color
+monokaiYellow = rgb 0xE6DB74
+
+-- | Hex value: 0x75715E
+monokaiYellowDark :: Color
+monokaiYellowDark = rgb 0x75715E
+
+-- | Hex value: 0xF8F8F2
+monokaiYellowLight :: Color
+monokaiYellowLight = rgb 0xF8F8F2
diff --git a/yi-monokai.cabal b/yi-monokai.cabal
new file mode 100644
index 0000000..0f01f27
--- /dev/null
+++ b/yi-monokai.cabal
@@ -0,0 +1,19 @@
+name: yi-monokai
+version: 0.1.0.0
+synopsis: Monokai colour scheme for the Yi text editor
+homepage: https://github.com/Fuuzetsu/yi-monokai
+license: BSD3
+license-file: LICENSE
+author: Mateusz Kowalczyk
+maintainer: fuuzetsu@fuuzetsu.co.uk
+category: Yi
+build-type: Simple
+extra-source-files: README.md
+cabal-version: >=1.10
+
+library
+ hs-source-dirs: src
+ default-language: Haskell2010
+ exposed-modules: Yi.Style.Monokai
+
+ build-depends: base >=4.6 && <4.7, yi >=0.7