Skip to content

Commit 13f6484

Browse files
committed
Release v2.0.5 - Shuffle Gradient
1 parent 19a6ea4 commit 13f6484

File tree

10 files changed

+154
-12
lines changed

10 files changed

+154
-12
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ CoolHue is also available as a node module. You can read [How it works](https://
2121
`npm install --save-dev coolhue`
2222

2323
## Sketch App Plugin
24-
1. Download [`Coolhue.sketchplugin.zip`](https://github.com/webkul/coolhue/releases/download/v2.0.4/CoolHue.sketchplugin.zip)
24+
1. Download [`Coolhue.sketchplugin.zip`](https://github.com/webkul/coolhue/releases/download/v2.0.5/CoolHue.sketchplugin.zip)
2525
2. Extract the archive
2626
3. Install `Coolhue.sketchplugin` for Sketch App
2727
4. Access it from Sketch's Menu Bar. Go to `Plugins` ➡️ `Coolhue` ➡️ `Palette`

appcast.xml

+4
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@
1313
<title>Version 2.0.4</title>
1414
<enclosure url="https://github.com/webkul/coolhue/releases/download/v2.0.4/CoolHue.sketchplugin.zip" sparkle:version="2.0.4"/>
1515
</item>
16+
<item>
17+
<title>Version 2.0.5</title>
18+
<enclosure url="https://github.com/webkul/coolhue/releases/download/v2.0.5/CoolHue.sketchplugin.zip" sparkle:version="2.0.5"/>
19+
</item>
1620
</channel>
1721
</rss>

distro/CoolHue.sketchplugin/Contents/Resources/_webpack_resources/ba2d9836387884f15f45466d8db71894.html distro/CoolHue.sketchplugin/Contents/Resources/_webpack_resources/f26f00243c3832631637c6f76c717088.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
<div class="controller">
2020
<div class="grd">
2121
<div class="grd-lt">
22-
<h2 class="cl-title">CoolHue v2.0.0</h2>
22+
<h2 class="cl-title">CoolHue v2.0.5</h2>
2323
</div>
2424
<div class="grd-rt">
25+
<span class="cl-shuffle"></span>
2526
<span class="cl-theme"></span>
2627
</div>
2728
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
//Initialization
2+
let initHandler = () => {
3+
window.document.addEventListener('contextmenu', event => event.preventDefault());
4+
var getPaint = document.getElementById("paint");
5+
var clTheme = document.querySelector(".cl-theme");
6+
var clShuffle = document.querySelector(".cl-shuffle");
7+
var getBody = document.body;
8+
9+
var gradientRand = () => {
10+
return "#" + Math.random().toString(16).substr(2,6);
11+
}
12+
var data = [
13+
["#FDEB71", "#F8D800"],
14+
["#ABDCFF", "#0396FF"],
15+
["#FEB692", "#EA5455"],
16+
["#CE9FFC", "#7367F0"],
17+
["#90F7EC", "#32CCBC"],
18+
["#FFF6B7", "#F6416C"],
19+
["#81FBB8", "#28C76F"],
20+
["#E2B0FF", "#9F44D3"],
21+
["#F97794", "#623AA2"],
22+
["#FCCF31", "#F55555"],
23+
["#F761A1", "#8C1BAB"],
24+
["#43CBFF", "#9708CC"],
25+
["#5EFCE8", "#736EFE"],
26+
["#FAD7A1", "#E96D71"],
27+
["#FFD26F", "#3677FF"],
28+
["#A0FE65", "#FA016D"],
29+
["#FFDB01", "#0E197D"],
30+
["#FEC163", "#DE4313"],
31+
["#92FFC0", "#002661"],
32+
["#EEAD92", "#6018DC"],
33+
["#F6CEEC", "#D939CD"],
34+
["#52E5E7", "#130CB7"],
35+
["#F1CA74", "#A64DB6"],
36+
["#E8D07A", "#5312D6"],
37+
["#EECE13", "#B210FF"],
38+
["#79F1A4", "#0E5CAD"],
39+
["#FDD819", "#E80505"],
40+
["#FFF3B0", "#CA26FF"],
41+
["#FFF5C3", "#9452A5"],
42+
["#F05F57", "#360940"],
43+
["#2AFADF", "#4C83FF"],
44+
["#FFF886", "#F072B6"],
45+
["#97ABFF", "#123597"],
46+
["#F5CBFF", "#C346C2"],
47+
["#FFF720", "#3CD500"],
48+
["#FF6FD8", "#3813C2"],
49+
["#EE9AE5", "#5961F9"],
50+
["#FFD3A5", "#FD6585"],
51+
["#C2FFD8", "#465EFB"],
52+
["#FD6585", "#0D25B9"],
53+
["#FD6E6A", "#FFC600"],
54+
["#65FDF0", "#1D6FA3"],
55+
["#6B73FF", "#000DFF"],
56+
["#FF7AF5", "#513162"],
57+
["#F0FF00", "#58CFFB"],
58+
["#FFE985", "#FA742B"],
59+
["#FFA6B7", "#1E2AD2"],
60+
["#FFAA85", "#B3315F"],
61+
["#72EDF2", "#5151E5"],
62+
["#FF9D6C", "#BB4E75"],
63+
["#F6D242", "#FF52E5"],
64+
["#69FF97", "#00E4FF"],
65+
["#3B2667", "#BC78EC"],
66+
["#70F570", "#49C628"],
67+
["#3C8CE7", "#00EAFF"],
68+
["#FAB2FF", "#1904E5"],
69+
["#81FFEF", "#F067B4"],
70+
["#FFA8A8", "#FCFF00"],
71+
["#FFCF71", "#2376DD"],
72+
["#FF96F9", "#C32BAC"]
73+
];
74+
for (var i = 0; i < data.length; i++) {
75+
var createBrick = document.createElement("div");
76+
let firstColor = data[i][0];
77+
let secondColor = data[i][1];
78+
createBrick.dataset.firstColor = firstColor;
79+
createBrick.dataset.secondColor = secondColor;
80+
createBrick.classList.add("brick");
81+
createBrick.style.backgroundImage = "linear-gradient(135deg, " + firstColor + " 10%, " + secondColor + " 100%)";
82+
getPaint.appendChild(createBrick);
83+
}
84+
85+
86+
87+
if (typeof (Storage) != undefined) {
88+
var getTheme = localStorage.getItem("theme");
89+
if (getTheme != undefined && getTheme === "dark") {
90+
getBody.classList.add("dark");
91+
}
92+
clTheme.addEventListener("click", () => {
93+
if (getBody.classList.contains("dark")) {
94+
getBody.classList.remove("dark");
95+
localStorage.setItem("theme", "bright");
96+
} else {
97+
getBody.classList.add("dark");
98+
localStorage.setItem("theme", "dark");
99+
}
100+
})
101+
}
102+
103+
window.addEventListener("click", (ev) => {
104+
if (ev.target.matches(".brick")) {
105+
var tempObj = new Object();
106+
tempObj["firstColor"] = ev.target.dataset.firstColor;
107+
tempObj["secondColor"] = ev.target.dataset.secondColor;
108+
window.postMessage('nativeGradientApplier', tempObj);
109+
}
110+
});
111+
112+
clShuffle.addEventListener("click", () => {
113+
var tempObj = new Object();
114+
tempObj["firstColor"] = gradientRand();
115+
tempObj["secondColor"] = gradientRand();
116+
window.postMessage('nativeGradientApplier', tempObj);
117+
});
118+
//Handler
119+
}
120+
121+
//Trigger Intialization
122+
window.addEventListener("load", initHandler);

distro/CoolHue.sketchplugin/Contents/Resources/core/assets/script.min.js

+6-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

distro/CoolHue.sketchplugin/Contents/Resources/core/assets/style.css

+16-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,17 @@ body {
105105
display: inline-block;
106106
vertical-align: middle;
107107
background-image: url("../images/sprite.png");
108-
background-position: left center;
108+
background-position: 0px 0px;
109+
}
110+
111+
.grd-rt .cl-shuffle {
112+
width: 18px;
113+
height: 18px;
114+
display: inline-block;
115+
vertical-align: middle;
116+
background-image: url("../images/sprite.png");
117+
background-position: -36px 0px;
118+
margin-right: 7px;
109119
}
110120

111121
body.dark {
@@ -121,5 +131,9 @@ body.dark .grd-lt h2.cl-title {
121131
}
122132

123133
body.dark .grd-rt .cl-theme {
124-
background-position: right center;
134+
background-position: -18px 0px;
135+
}
136+
137+
body.dark .grd-rt .cl-shuffle {
138+
background-position: -54px 0px;
125139
}
Loading

distro/CoolHue.sketchplugin/Contents/Sketch/coolhue.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

distro/CoolHue.sketchplugin/Contents/Sketch/coolhue.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

distro/CoolHue.sketchplugin/Contents/Sketch/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
]
1717
},
1818
"appcast": "https://raw.githubusercontent.com/webkul/coolhue/master/appcast.xml",
19-
"version": "2.0.4",
19+
"version": "2.0.5",
2020
"description": "Coolest handpicked Gradient Hues and Swatches",
2121
"name": "CoolHue",
2222
"identifier": "CoolHue",

0 commit comments

Comments
 (0)