From 357eac75043094087ca7f2a30283dba70261da1e Mon Sep 17 00:00:00 2001 From: Levi Tan Ong Date: Wed, 13 Apr 2016 16:33:12 +0800 Subject: [PATCH 1/4] adds chroma --- chroma/README.md | 18 +++++++++ chroma/build.boot | 26 ++++++++++++ .../cljsjs/chroma/common/chroma.ext.js | 40 +++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 chroma/README.md create mode 100644 chroma/build.boot create mode 100644 chroma/resources/cljsjs/chroma/common/chroma.ext.js diff --git a/chroma/README.md b/chroma/README.md new file mode 100644 index 000000000..9482236b3 --- /dev/null +++ b/chroma/README.md @@ -0,0 +1,18 @@ +# cljsjs/chroma + +[](dependency) +```clojure +[cljsjs/chroma "1.1.1-0"] ;; latest release +``` + +[](/dependency) +```clojure +(ns application.core + (:require cljsjs.chroma :as [chroma])) + +(-> (js/chroma "#D4F880") + (.darken) + (.hex)) + +;; #9BC04B +``` diff --git a/chroma/build.boot b/chroma/build.boot new file mode 100644 index 000000000..06d941af8 --- /dev/null +++ b/chroma/build.boot @@ -0,0 +1,26 @@ +(set-env! + :resource-paths #{"resources"} + :dependencies '[[cljsjs/boot-cljsjs "0.5.1" :scope "test"]]) + +(require '[cljsjs.boot-cljsjs.packaging :refer :all]) + +(def +lib-version+ "1.1.1") +(def +version+ (str +lib-version+ "-0")) + +(task-options! + pom {:project 'cljsjs/chroma + :version +version+ + :description "A lightweight but powerful library for dealing with colors" + :url "http://gka.github.io/chroma.js/" + :scm {:url "https://github.com/cljsjs/packages"} + :license {"BSD" "http://opensource.org/licenses/BSD-3-Clause"}}) + +(deftask package [] + (comp + (download :url "https://raw.githubusercontent.com/gka/chroma.js/master/chroma.js" + :checksum "9934cec41827bc13a64ab313722e3ff4") + (sift :move {#"chroma.js" "cljsjs/colorbrewer/development/chroma.inc.js"}) + (sift :include #{#"^cljsjs"}) + (deps-cljs :name "cljsjs.chroma") + (pom) + (jar))) diff --git a/chroma/resources/cljsjs/chroma/common/chroma.ext.js b/chroma/resources/cljsjs/chroma/common/chroma.ext.js new file mode 100644 index 000000000..c28488c8a --- /dev/null +++ b/chroma/resources/cljsjs/chroma/common/chroma.ext.js @@ -0,0 +1,40 @@ +var chroma = { + "version": {}, + "_input": {}, + "brewer": {}, + "colors": {}, + "lab": function () {}, + "bezier": function () {}, + "cubehelix": function () {}, + "random": function () {}, + "rgb": function () {}, + "hex": function () {}, + "hsl": function () {}, + "hsv": function () {}, + "num": function () {}, + "css": function () {}, + "lch": function () {}, + "hcl": function () {}, + "cmyk": function () {}, + "gl": function () {}, + "interpolate": function () {}, + "mix": function () {}, + "kelvin": function () {}, + "temperature": function () {}, + "contrast": function () {}, + "blend": { + "normal": function () {}, + "multiply": function () {}, + "screen": function () {}, + "overlay": function () {}, + "darken": function () {}, + "lighten": function () {}, + "dodge": function () {}, + "burn": function () {} + }, + "analyze": function () {}, + "scale": function () {}, + "scales": {}, + "limits": function () {}, + "hsi": function () {} +}; From 65ec8bd0acc3f6f2becbdcf34bb8185b9d457240 Mon Sep 17 00:00:00 2001 From: Levi Tan Ong Date: Wed, 13 Apr 2016 16:35:08 +0800 Subject: [PATCH 2/4] minor bug fix --- chroma/build.boot | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chroma/build.boot b/chroma/build.boot index 06d941af8..e81b9e854 100644 --- a/chroma/build.boot +++ b/chroma/build.boot @@ -1,6 +1,6 @@ (set-env! - :resource-paths #{"resources"} - :dependencies '[[cljsjs/boot-cljsjs "0.5.1" :scope "test"]]) + :resource-paths #{"resources"} + :dependencies '[[cljsjs/boot-cljsjs "0.5.1" :scope "test"]]) (require '[cljsjs.boot-cljsjs.packaging :refer :all]) @@ -17,9 +17,9 @@ (deftask package [] (comp - (download :url "https://raw.githubusercontent.com/gka/chroma.js/master/chroma.js" - :checksum "9934cec41827bc13a64ab313722e3ff4") - (sift :move {#"chroma.js" "cljsjs/colorbrewer/development/chroma.inc.js"}) + (download :url "https://raw.githubusercontent.com/gka/chroma.js/master/chroma.js" + :checksum "9934cec41827bc13a64ab313722e3ff4") + (sift :move {#"chroma.js" "cljsjs/chroma/development/chroma.inc.js"}) (sift :include #{#"^cljsjs"}) (deps-cljs :name "cljsjs.chroma") (pom) From 50da42b4fa25a7a6a9c9fc8269b69d38ab119180 Mon Sep 17 00:00:00 2001 From: Levi Tan Ong Date: Thu, 14 Apr 2016 00:35:48 +0800 Subject: [PATCH 3/4] proper way of including the files --- chroma/build.boot | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chroma/build.boot b/chroma/build.boot index e81b9e854..85007c00a 100644 --- a/chroma/build.boot +++ b/chroma/build.boot @@ -17,9 +17,10 @@ (deftask package [] (comp - (download :url "https://raw.githubusercontent.com/gka/chroma.js/master/chroma.js" - :checksum "9934cec41827bc13a64ab313722e3ff4") - (sift :move {#"chroma.js" "cljsjs/chroma/development/chroma.inc.js"}) + (download :url (str "https://github.com/gka/chroma.js/archive/v" +lib-version+ ".zip") + :checksum "d19a64f11d845700c5e5c4a647882404") + (sift :move {#"chroma.js" "cljsjs/chroma/development/chroma.inc.js" + #"chroma.min.js" "cljsjs/chroma/production/chroma.min.inc.js"}) (sift :include #{#"^cljsjs"}) (deps-cljs :name "cljsjs.chroma") (pom) From bd2eb7bbc9400d9bef05ac6778fbee0152b5e68a Mon Sep 17 00:00:00 2001 From: Levi Tan Ong Date: Thu, 14 Apr 2016 00:37:51 +0800 Subject: [PATCH 4/4] unzip file --- chroma/build.boot | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chroma/build.boot b/chroma/build.boot index 85007c00a..aa119d6e2 100644 --- a/chroma/build.boot +++ b/chroma/build.boot @@ -18,7 +18,8 @@ (deftask package [] (comp (download :url (str "https://github.com/gka/chroma.js/archive/v" +lib-version+ ".zip") - :checksum "d19a64f11d845700c5e5c4a647882404") + :checksum "d19a64f11d845700c5e5c4a647882404" + :unzip true) (sift :move {#"chroma.js" "cljsjs/chroma/development/chroma.inc.js" #"chroma.min.js" "cljsjs/chroma/production/chroma.min.inc.js"}) (sift :include #{#"^cljsjs"})