only keep purescript

This commit is contained in:
Yann Esposito (Yogsototh) 2020-03-02 00:32:59 +01:00
parent 5216e77e0a
commit 2ca9551a54
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646
36 changed files with 12 additions and 613 deletions

View file

15
.gitignore vendored
View file

@ -1,3 +1,12 @@
.stack-work/ /bower_components/
solaryzed.cabal /node_modules/
*~ /.pulp-cache/
/output/
/generated-docs/
/.psc-package/
/.psc*
/.purs*
/.psa*
/.spago
.cache
dist

View file

View file

@ -1,3 +0,0 @@
# Changelog for solaryzed
## Unreleased changes

View file

@ -1,30 +0,0 @@
Copyright Author name here (c) 2019
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 Author name here nor the names of other
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
OWNER 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.

View file

@ -1 +0,0 @@
# solaryzed

View file

@ -1,2 +0,0 @@
import Distribution.Simple
main = defaultMain

View file

@ -1,40 +0,0 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Protolude
import Data.Prizm.Color (HexRGB (..))
import qualified Data.Text as Text
import qualified Data.Text.Format as Format
import qualified Data.Text.Lazy.IO as LazyIO
import qualified Data.Text.Lazy as LazyText
import System.Environment (getArgs)
import Solaryzed
main :: IO ()
main = do
args <- map (HexRGB . toS) <$> getArgs
tpl <- toS <$> LazyIO.readFile "resources/example.tpl"
case args of
[dark,light,accent] -> genPaletteFile tpl (dark,light,accent)
_ -> do
putText "Please give 3 colors in HEX format, dark, light and an accent color; you have given"
print args
genPaletteFile :: Text -> (HexRGB,HexRGB,HexRGB) -> IO ()
genPaletteFile tpl (dark,light,accent) = do
let palette = map toS $ genAnnotatedPalette dark light accent
html = Text.replace "$palette$" (Text.intercalate "\n\t" palette) tpl
filename = Format.format "palette-{}-{}-{}.html" (Text.drop 1 $ unHexRGB dark,
Text.drop 1 $ unHexRGB light,
Text.drop 1 $ unHexRGB accent)
LazyIO.writeFile (toS filename) (toS html)
putText (toS filename)
genAnnotatedPalette :: HexRGB -> HexRGB -> HexRGB -> [Text]
genAnnotatedPalette dark light accent = do
let palette = map unHexRGB $ genExtendedPalette dark light accent
annotated = zip extendedPaletteLabels palette
map (toS . Format.format "--{}: {};\n") annotated

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,161 +0,0 @@
<html>
<head>
<style>
:root {
--base03: #212630;
--base02: #2c303a;
--base01: #676b72;
--base00: #74777e;
--base0: #8e9197;
--base1: #9b9ea3;
--base2: #e7e8ea;
--base3: #f5f6f7;
--magenta: #d63878;
--red: #d73c55;
--orange: #c45521;
--yellow: #937300;
--green: #008c3c;
--cyan: #00909b;
--blue: #008dcb;
--violet: #b84caf;
--magenta-d: #8b003c;
--red-d: #8a001e;
--orange-d: #791100;
--yellow-d: #503800;
--green-d: #004b00;
--cyan-d: #004e5c;
--blue-d: #004d87;
--violet-d: #72006d;
--magenta-l: #ff82b9;
--red-l: #ff8593;
--orange-l: #ff975e;
--yellow-l: #dcb438;
--green-l: #46d17a;
--cyan-l: #00d6e0;
--blue-l: #00d1ff;
--violet-l: #ff90f5;
}
div.dark > div , div.light > div {
width: 80px;
height: 40px;
line-height: 40px;
display: inline-block;
text-align: center;
margin: 1px;
}
html {
background-color: var(--base03);
font-family: monospace;
font-weight: bold;
color: var(--base0);
}
body { width: 730px; margin: 0 auto; }
.dark {background-color: var(--base03); width: 100%; margin: 20px; padding: 20px; }
.dark > .base2, .dark > .base3 { visibility: hidden; }
.light {background-color: var(--base3); width: 100%; margin: 20px; padding: 20px; }
.light > .base02, .light > .base03 { visibility: hidden; }
.base03 { background-color: var(--base03); color: var(--base0); }
.base02 { background-color: var(--base02); color: var(--base1); }
.base01 { color: var(--base01); }
.base00 { color: var(--base00); }
.base0 { color: var(--base0); }
.base1 { color: var(--base1); }
.base2 { background-color: var(--base2); color: var(--base01); }
.base3 { background-color: var(--base3); color: var(--base00); }
.magenta { color: var(--magenta); }
.red { color: var(--red); }
.orange { color: var(--orange); }
.yellow { color: var(--yellow); }
.green { color: var(--green); }
.cyan { color: var(--cyan); }
.blue { color: var(--blue); }
.violet { color: var(--violet); }
.magenta-d { color: var(--magenta-d); }
.red-d { color: var(--red-d); }
.orange-d { color: var(--orange-d); }
.yellow-d { color: var(--yellow-d); }
.green-d { color: var(--green-d); }
.cyan-d { color: var(--cyan-d); }
.blue-d { color: var(--blue-d); }
.violet-d { color: var(--violet-d); }
.magenta-l { color: var(--magenta-l); }
.red-l { color: var(--red-l); }
.orange-l { color: var(--orange-l); }
.yellow-l { color: var(--yellow-l); }
.green-l { color: var(--green-l); }
.cyan-l { color: var(--cyan-l); }
.blue-l { color: var(--blue-l); }
.violet-l { color: var(--violet-l); }
</style>
</head>
<body>
<div class="dark">
<div class="base03">base03</div>
<div class="base02">base02</div>
<div class="base01">base01</div>
<div class="base00">base00</div>
<div class="base0">base0</div>
<div class="base1">base1</div>
<div class="base2">base2</div>
<div class="base3">base3</div>
<div class="magenta">magenta</div>
<div class="red">red</div>
<div class="orange">orange</div>
<div class="yellow">yellow</div>
<div class="green">green</div>
<div class="cyan">cyan</div>
<div class="blue">blue</div>
<div class="violet">violet</div>
<div class="magenta-d">magenta-d</div>
<div class="red-d">red-d</div>
<div class="orange-d">orange-d</div>
<div class="yellow-d">yellow-d</div>
<div class="green-d">green-d</div>
<div class="cyan-d">cyan-d</div>
<div class="blue-d">blue-d</div>
<div class="violet-d">violet-d</div>
<div class="magenta-l">magenta-l</div>
<div class="red-l">red-l</div>
<div class="orange-l">orange-l</div>
<div class="yellow-l">yellow-l</div>
<div class="green-l">green-l</div>
<div class="cyan-l">cyan-l</div>
<div class="blue-l">blue-l</div>
<div class="violet-l">violet-l</div>
</div>
<div class="light">
<div class="base03">base03</div>
<div class="base02">base02</div>
<div class="base01">base01</div>
<div class="base00">base00</div>
<div class="base0">base0</div>
<div class="base1">base1</div>
<div class="base2">base2</div>
<div class="base3">base3</div>
<div class="magenta">magenta</div>
<div class="red">red</div>
<div class="orange">orange</div>
<div class="yellow">yellow</div>
<div class="green">green</div>
<div class="cyan">cyan</div>
<div class="blue">blue</div>
<div class="violet">violet</div>
<div class="magenta-d">magenta-d</div>
<div class="red-d">red-d</div>
<div class="orange-d">orange-d</div>
<div class="yellow-d">yellow-d</div>
<div class="green-d">green-d</div>
<div class="cyan-d">cyan-d</div>
<div class="blue-d">blue-d</div>
<div class="violet-d">violet-d</div>
<div class="magenta-l">magenta-l</div>
<div class="red-l">red-l</div>
<div class="orange-l">orange-l</div>
<div class="yellow-l">yellow-l</div>
<div class="green-l">green-l</div>
<div class="cyan-l">cyan-l</div>
<div class="blue-l">blue-l</div>
<div class="violet-l">violet-l</div>
</div>
</body>
</html>

View file

@ -1,53 +0,0 @@
name: solaryzed
version: 0.1.0.0
github: "githubuser/solaryzed"
license: BSD3
author: "Author name here"
maintainer: "example@example.com"
copyright: "2019 Author name here"
extra-source-files:
- README.md
- ChangeLog.md
# Metadata used when publishing your package
# synopsis: Short description of your package
# category: Web
# To avoid duplicated efforts in documentation and dealing with the
# complications of embedding Haddock markup inside cabal files, it is
# common to point users to the README.md file.
description: Please see the README on GitHub at <https://github.com/githubuser/solaryzed#readme>
dependencies:
- base >= 4.7 && < 5
- protolude
- prizm
- convertible
- text
- text-format
library:
source-dirs: src
executables:
solaryzed-exe:
main: Main.hs
source-dirs: app
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- solaryzed
tests:
solaryzed-test:
main: Spec.hs
source-dirs: test
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- solaryzed

View file

@ -1,130 +0,0 @@
<html>
<head>
<style>
:root {
$palette$
}
div.dark > div , div.light > div {
width: 80px;
height: 40px;
line-height: 40px;
display: inline-block;
text-align: center;
margin: 1px;
}
html {
background-color: var(--base03);
font-family: monospace;
font-weight: bold;
color: var(--base0);
}
body { width: 730px; margin: 0 auto; }
.dark {background-color: var(--base03); width: 100%; margin: 20px; padding: 20px; }
.dark > .base2, .dark > .base3 { visibility: hidden; }
.light {background-color: var(--base3); width: 100%; margin: 20px; padding: 20px; }
.light > .base02, .light > .base03 { visibility: hidden; }
.base03 { background-color: var(--base03); color: var(--base0); }
.base02 { background-color: var(--base02); color: var(--base1); }
.base01 { color: var(--base01); }
.base00 { color: var(--base00); }
.base0 { color: var(--base0); }
.base1 { color: var(--base1); }
.base2 { background-color: var(--base2); color: var(--base01); }
.base3 { background-color: var(--base3); color: var(--base00); }
.magenta { color: var(--magenta); }
.red { color: var(--red); }
.orange { color: var(--orange); }
.yellow { color: var(--yellow); }
.green { color: var(--green); }
.cyan { color: var(--cyan); }
.blue { color: var(--blue); }
.violet { color: var(--violet); }
.magenta-d { color: var(--magenta-d); }
.red-d { color: var(--red-d); }
.orange-d { color: var(--orange-d); }
.yellow-d { color: var(--yellow-d); }
.green-d { color: var(--green-d); }
.cyan-d { color: var(--cyan-d); }
.blue-d { color: var(--blue-d); }
.violet-d { color: var(--violet-d); }
.magenta-l { color: var(--magenta-l); }
.red-l { color: var(--red-l); }
.orange-l { color: var(--orange-l); }
.yellow-l { color: var(--yellow-l); }
.green-l { color: var(--green-l); }
.cyan-l { color: var(--cyan-l); }
.blue-l { color: var(--blue-l); }
.violet-l { color: var(--violet-l); }
</style>
</head>
<body>
<div class="dark">
<div class="base03">base03</div>
<div class="base02">base02</div>
<div class="base01">base01</div>
<div class="base00">base00</div>
<div class="base0">base0</div>
<div class="base1">base1</div>
<div class="base2">base2</div>
<div class="base3">base3</div>
<div class="magenta">magenta</div>
<div class="red">red</div>
<div class="orange">orange</div>
<div class="yellow">yellow</div>
<div class="green">green</div>
<div class="cyan">cyan</div>
<div class="blue">blue</div>
<div class="violet">violet</div>
<div class="magenta-d">magenta-d</div>
<div class="red-d">red-d</div>
<div class="orange-d">orange-d</div>
<div class="yellow-d">yellow-d</div>
<div class="green-d">green-d</div>
<div class="cyan-d">cyan-d</div>
<div class="blue-d">blue-d</div>
<div class="violet-d">violet-d</div>
<div class="magenta-l">magenta-l</div>
<div class="red-l">red-l</div>
<div class="orange-l">orange-l</div>
<div class="yellow-l">yellow-l</div>
<div class="green-l">green-l</div>
<div class="cyan-l">cyan-l</div>
<div class="blue-l">blue-l</div>
<div class="violet-l">violet-l</div>
</div>
<div class="light">
<div class="base03">base03</div>
<div class="base02">base02</div>
<div class="base01">base01</div>
<div class="base00">base00</div>
<div class="base0">base0</div>
<div class="base1">base1</div>
<div class="base2">base2</div>
<div class="base3">base3</div>
<div class="magenta">magenta</div>
<div class="red">red</div>
<div class="orange">orange</div>
<div class="yellow">yellow</div>
<div class="green">green</div>
<div class="cyan">cyan</div>
<div class="blue">blue</div>
<div class="violet">violet</div>
<div class="magenta-d">magenta-d</div>
<div class="red-d">red-d</div>
<div class="orange-d">orange-d</div>
<div class="yellow-d">yellow-d</div>
<div class="green-d">green-d</div>
<div class="cyan-d">cyan-d</div>
<div class="blue-d">blue-d</div>
<div class="violet-d">violet-d</div>
<div class="magenta-l">magenta-l</div>
<div class="red-l">red-l</div>
<div class="orange-l">orange-l</div>
<div class="yellow-l">yellow-l</div>
<div class="green-l">green-l</div>
<div class="cyan-l">cyan-l</div>
<div class="blue-l">blue-l</div>
<div class="violet-l">violet-l</div>
</div>
</body>
</html>

View file

@ -1,88 +0,0 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Solaryzed
( genPalette
, paletteLabels
, genExtendedPalette
, extendedPaletteLabels
) where
import Protolude
import Data.Convertible.Base (convert)
import Data.Prizm.Color (HexRGB (..), LAB (..), LCH (..), mkLAB,
mkLCH)
import Data.Prizm.Types (ColorCoord (..))
import Data.Text (Text)
-- | given the *a *b of the darkest and lightest colors
-- generate all the CIE of the solarized needed colors
-- from base03 to base3
genBase :: Double -> Double -> Double -> Double -> [HexRGB]
genBase adark bdark alight blight =
map (convert . (\n -> mkLAB n (ratio n adark alight) (ratio n bdark blight)))
[10.0,15,40,50,60,70,92,97]
where
ratio :: Double -> Double -> Double -> Double
ratio n d l = ((97 - n)*d + (n-15)*l)/82
genColors :: HexRGB -> [HexRGB]
genColors exampleColor =
let (ColorCoord (l,c,h)) = unLCH (convert exampleColor)
in map (convert . mkLCH 50 c) [1, 18, 45, 68, 175, 205, 237, 331]
-- | Generate a solarized-like palette given 3 colors
-- base03, base3 and a color like yellow
genPalette :: HexRGB -> HexRGB -> HexRGB -> [Text]
genPalette dark light exampleColor = map unHexRGB $
genBase adark bdark alight blight <> genColors exampleColor
where
(ColorCoord (_,adark,bdark)) = unLAB (convert dark)
(ColorCoord (_,alight,blight)) = unLAB (convert light)
genExtendedColors :: HexRGB -> [HexRGB]
genExtendedColors exampleColor =
let (ColorCoord (l,c,h)) = unLCH (convert exampleColor)
hues = [1, 18, 45, 68, 175, 205, 237, 331]
-- hues = map (fromIntegral . (`rem` 360) . floor . (h+)) [i * 45 | i <- [0..7]]
in map (convert . mkLCH 60 c) hues
<> map (convert . mkLCH 35 c) hues
<> map (convert . mkLCH 85 c) hues
genExtendedPalette :: HexRGB -> HexRGB -> HexRGB -> [HexRGB]
genExtendedPalette darkc lightc accentc =
genBase adark bdark alight blight <> genExtendedColors accentc
where
(ColorCoord (_,adark,bdark)) = unLAB (convert darkc)
(ColorCoord (_,alight,blight)) = unLAB (convert lightc)
baseLabels :: [Text]
baseLabels = [ "base03"
, "base02"
, "base01"
, "base00"
, "base0"
, "base1"
, "base2"
, "base3"
]
colorLabels :: [Text]
colorLabels = [ "magenta"
, "red"
, "orange"
, "yellow"
, "green"
, "cyan"
, "blue"
, "violet"
]
paletteLabels :: [Text]
paletteLabels = baseLabels
<> colorLabels
extendedPaletteLabels :: [Text]
extendedPaletteLabels = paletteLabels
<> map (<> "-d") colorLabels
<> map (<> "-l") colorLabels

View file

@ -1,68 +0,0 @@
# This file was automatically generated by 'stack init'
#
# Some commonly used options have been documented as comments in this file.
# For advanced use and comprehensive documentation of the format, please see:
# https://docs.haskellstack.org/en/stable/yaml_configuration/
# Resolver to choose a 'specific' stackage snapshot or a compiler version.
# A snapshot resolver dictates the compiler version and the set of packages
# to be used for project dependencies. For example:
#
# resolver: lts-3.5
# resolver: nightly-2015-09-21
# resolver: ghc-7.10.2
#
# The location of a snapshot can be provided as a file or url. Stack assumes
# a snapshot provided as a file might change, whereas a url resource does not.
#
# resolver: ./custom-snapshot.yaml
# resolver: https://example.com/snapshots/2018-01-01.yaml
resolver: lts-14.11
# User packages to be built.
# Various formats can be used as shown in the example below.
#
# packages:
# - some-directory
# - https://example.com/foo/bar/baz-0.0.2.tar.gz
# subdirs:
# - auto-update
# - wai
packages:
- .
# Dependency packages to be pulled from upstream that are not in the resolver.
# These entries can reference officially published versions as well as
# forks / in-progress versions pinned to a git hash. For example:
#
# extra-deps:
# - acme-missiles-0.3
# - git: https://github.com/commercialhaskell/stack.git
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
#
# extra-deps: []
extra-deps:
- prizm-3.0.0
# Override default flag values for local packages and extra-deps
# flags: {}
# Extra package databases containing global packages
# extra-package-dbs: []
# Control whether we use the GHC we find on the path
# system-ghc: true
#
# Require a specific version of stack, using version ranges
# require-stack-version: -any # Default
# require-stack-version: ">=2.1"
#
# Override the architecture used by stack, especially useful on Windows
# arch: i386
# arch: x86_64
#
# Extra directories used by stack for building
# extra-include-dirs: [/path/to/dir]
# extra-lib-dirs: [/path/to/dir]
#
# Allow a newer minor version of GHC than the snapshot specifies
# compiler-check: newer-minor

View file

@ -1,19 +0,0 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files
packages:
- completed:
hackage: prizm-3.0.0@sha256:f7b7c3992c5070b8b2275f04c9a5b321904cbfc9ea85dfeccd4d9a626fcc26e1,2650
pantry-tree:
size: 1233
sha256: 0525fee0ef9bacafa4a2eb75cea726ef9e06c1cc050c86e60b127f631c1ed676
original:
hackage: prizm-3.0.0
snapshots:
- completed:
size: 524786
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/14/11.yaml
sha256: 088bb91b545839510a41ae92fa5feb36779ef3529571a42bd12b9f51eb89ded3
original: lts-14.11

View file

@ -1,2 +0,0 @@
main :: IO ()
main = putStrLn "Test suite not yet implemented"

12
ui/.gitignore vendored
View file

@ -1,12 +0,0 @@
/bower_components/
/node_modules/
/.pulp-cache/
/output/
/generated-docs/
/.psc-package/
/.psc*
/.purs*
/.psa*
/.spago
.cache
dist