Color Wheel
How do I make an color wheel?
What is a color wheel? How do you make a color wheel? This script and codes were developed by Thepheer on 13 September 2022, Tuesday.
Color Wheel - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Color Wheel</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <template id='ColorWheel'> <div class='color-wheel'> <div> <router-link v-for='(_, name) in modes' :to='name' replace>{{ name }}</router-link> <slider v-for='(cfg, name) in sliders' :cfg='cfg'>{{ name | capitalize }}</slider> </div> <color v-for='i in items' :mode='mode' :h='360/items*i' :s='sliders.saturation.value' :l='sliders.lightness.value'></color> </div>
</template>
<template id='ColorWheel-Slider'> <div class='control'> <div class='hl'> <span class='right'>{{ cfg.value }}</span> <slot></slot> </div> <input type='range' v-model.number='cfg.value' :min='cfg.min' :max='cfg.max' :step='cfg.step' /> </div>
</template>
<template id='ColorWheel-Color'> <div class='color' :style='style'>{{ color | uppercase }}</div>
</template>
<template id='App'> <router-view></router-view>
</template> <script src='http://unpkg.com/vue'></script>
<script src='http://unpkg.com/vue-router'></script>
<script src='http://unpkg.com/hsluv'></script>
<script src='http://unpkg.com/onecolor/one-color.js'></script> <script src="js/index.js"></script>
</body>
</html>
Color Wheel - Script Codes CSS Codes
@import url('https://fonts.googleapis.com/css?family=Inconsolata');
@media (min-height: 0px) { html { font-size: 8px; } }
@media (min-height: 360px) { html { font-size: 10px; } }
@media (min-height: 432px) { html { font-size: 12px; } }
@media (min-height: 504px) { html { font-size: 14px; } }
@media (min-height: 576px) { html { font-size: 16px; } }
@media (min-height: 648px) { html { font-size: 18px; } }
@media (min-height: 720px) { html { font-size: 20px; } }
@media (min-height: 792px) { html { font-size: 22px; } }
@media (min-height: 864px) { html { font-size: 24px; } }
html { overflow: hidden; background: #2e3136; color: #717782;
}
.hl { color: #b0b9c9;
}
a { display: block; color: inherit;
}
a:not(:hover) { text-decoration: none;
}
/*input[type=range] { -webkit-appearance: none; background: #717782; height: .125em; outline: none;
}
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; background: #b0b9c9; width: .125em; height: 1em;
}*/
.color-wheel { position: absolute; top: 50%; left: 50%; font: 1em/1.15em 'Inconsolata', monospace;
}
.color-wheel > * { position: absolute; transform: translate(-50%, -50%);
}
.color-wheel .right { float: right;
}
.color-wheel .control:nth-child(1n+2) { margin-top: 1em;
}
.color-wheel .control label { display: block;
}
.color-wheel .control input { vertical-align: middle; margin: 0;
}
.color-wheel .control input[type=range] { font: inherit; width: 10em;
}
.color-wheel .color { position: absolute; /*padding: 0 .75em; border-radius: 2em; line-height: 2em; box-shadow: 0 0 .1em #1e2124; background: #36393e;*/
}
Color Wheel - Script Codes JS Codes
const modes = { HSL: ({h, s, l}) => one.color(`hsl(${h},${s}%,${l}%)`).hex(), HSLuv: ({h, s, l}) => hsluv.hsluvToHex([h, s, l]), HPLuv: ({h, s, l}) => hsluv.hpluvToHex([h, s, l])
};
const ColorWheel = Vue.extend({ template: '#ColorWheel', props: ['mode'], data: () => ({ modes, selectors: { mode: { value: 'HPLuv', list: modes } }, sliders: { saturation: { min: 0, max: 100, step: 1, value: 100 }, lightness: { min: 0, max: 100, step: 1, value: 75 }, density: { min: 1, max: 5, step: 1, value: 3 } } }), computed: { items: x => 3 * Math.pow(2, x.sliders.density.value) }, filters: { capitalize: x => x.charAt(0).toUpperCase() + x.slice(1) }, components: { color: { template: '#ColorWheel-Color', props: ['mode', 'h', 's', 'l'], computed: { color: x => modes[x.mode](x), style: x => ({ color: x.color, transform: `translate(-50%, -50%) rotate(${x.h}deg) translate(13em)` }) }, filters: { uppercase: x => x.toUpperCase() } }, slider: { template: '#ColorWheel-Slider', props: ['cfg'] } }
});
const router = new VueRouter({ linkActiveClass: 'hl', routes: [ { path: '/:mode', component: ColorWheel, props: true }, { path: '*', redirect: 'HSL' } ]
});
const app = new Vue({ template: '#App', router
});
document.body.appendChild(app.$mount().$el);
Developer | Thepheer |
Username | thepheer |
Uploaded | September 13, 2022 |
Rating | 4 |
Size | 3,070 Kb |
Views | 38,456 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Magnetic Field | 7,703 Kb |
100 000 particles | 4,379 Kb |
Strange Attactor | 3,907 Kb |
Flight Control | 5,989 Kb |
Emoji Clock | 2,336 Kb |
Audio Visualiser | 6,237 Kb |
A Pen by thepheer | 4,762 Kb |
WebGL shader video processing | 9,532 Kb |
Cylinder | 4,658 Kb |
Radix Converter | 3,488 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Awesome Full Page Menu Nav | Ey_intuitive | 4,194 Kb |
CSS-Flexbox-Demo | Sstiglets | 1,709 Kb |
A Pen by tugce | Ecgutcnkr | 4,197 Kb |
Hc first draft | Stepfray | 5,104 Kb |
A Pen by Malith Hettiarachchi | MalZiiirA | 5,531 Kb |
A Pen by Gregory Potdevin | GregoryPotdevin | 1,713 Kb |
Page Transitions in Backbone | Mikefowler | 3,691 Kb |
Large canvas mousemove experiment | Jibbon | 2,885 Kb |
Drag n Drop | Martin42 | 2,594 Kb |
Drag in vanilla js using dotval math instead of translate | Paulq | 2,662 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!