PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.6.15
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.6.15
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / assets / wpuf / vendor / sweetalert2 / src / utils / utils.js

utils.js in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.6.15, at assets/wpuf/vendor/sweetalert2/src/utils/utils.js

32 lines 842 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*
2 * Set hover, active and focus-states for buttons (source: http://www.sitepoint.com/javascript-generate-lighter-darker-color)
3 */
4 export const colorLuminance = (hex, lum) => {
5 // Validate hex string
6 hex = String(hex).replace(/[^0-9a-f]/gi, '')
7 if (hex.length < 6) {
8 hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]
9 }
10 lum = lum || 0
11
12 // Convert to decimal and change luminosity
13 let rgb = '#'
14 for (let i = 0; i < 3; i++) {
15 let c = parseInt(hex.substr(i * 2, 2), 16)
16 c = Math.round(Math.min(Math.max(0, c + (c * lum)), 255)).toString(16)
17 rgb += ('00' + c).substr(c.length)
18 }
19
20 return rgb
21 }
22
23 export const uniqueArray = (arr) => {
24 const result = []
25 for (var i in arr) {
26 if (result.indexOf(arr[i]) === -1) {
27 result.push(arr[i])
28 }
29 }
30 return result
31 }
32