diff options
author | Yigit Sever | 2024-08-30 11:06:19 +0200 |
---|---|---|
committer | Yigit Sever | 2024-08-30 11:06:19 +0200 |
commit | c2c54ed574d00d96a772e096abdfa2da3b60fdd6 (patch) | |
tree | bf61440b8c30dca5b69b949c5cd04f2b69c81379 /.config/hypr/shaders/solarized.frag | |
parent | 81cb7e952301e6ef240ae11434e05207cce39788 (diff) | |
download | dotfiles-c2c54ed574d00d96a772e096abdfa2da3b60fdd6.tar.gz dotfiles-c2c54ed574d00d96a772e096abdfa2da3b60fdd6.tar.bz2 dotfiles-c2c54ed574d00d96a772e096abdfa2da3b60fdd6.zip |
hypr: start tracking
Diffstat (limited to '.config/hypr/shaders/solarized.frag')
-rw-r--r-- | .config/hypr/shaders/solarized.frag | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/.config/hypr/shaders/solarized.frag b/.config/hypr/shaders/solarized.frag new file mode 100644 index 0000000..1c37f2c --- /dev/null +++ b/.config/hypr/shaders/solarized.frag | |||
@@ -0,0 +1,41 @@ | |||
1 | // -*- mode:c -*- | ||
2 | precision lowp float; | ||
3 | varying vec2 v_texcoord; | ||
4 | uniform sampler2D tex; | ||
5 | |||
6 | float distanceSquared(vec3 pixColor, vec3 solarizedColor) { | ||
7 | vec3 distanceVector = pixColor - solarizedColor; | ||
8 | return dot(distanceVector, distanceVector); | ||
9 | } | ||
10 | |||
11 | void main() { | ||
12 | vec3 solarized[16]; | ||
13 | solarized[0] = vec3(0.,0.169,0.212); | ||
14 | solarized[1] = vec3(0.027,0.212,0.259); | ||
15 | solarized[2] = vec3(0.345,0.431,0.459); | ||
16 | solarized[3] = vec3(0.396,0.482,0.514); | ||
17 | solarized[4] = vec3(0.514,0.58,0.588); | ||
18 | solarized[5] = vec3(0.576,0.631,0.631); | ||
19 | solarized[6] = vec3(0.933,0.91,0.835); | ||
20 | solarized[7] = vec3(0.992,0.965,0.89); | ||
21 | solarized[8] = vec3(0.71,0.537,0.); | ||
22 | solarized[9] = vec3(0.796,0.294,0.086); | ||
23 | solarized[10] = vec3(0.863,0.196,0.184); | ||
24 | solarized[11] = vec3(0.827,0.212,0.51); | ||
25 | solarized[12] = vec3(0.424,0.443,0.769); | ||
26 | solarized[13] = vec3(0.149,0.545,0.824); | ||
27 | solarized[14] = vec3(0.165,0.631,0.596); | ||
28 | solarized[15] = vec3(0.522,0.6,0.); | ||
29 | |||
30 | vec3 pixColor = vec3(texture2D(tex, v_texcoord)); | ||
31 | int closest = 0; | ||
32 | float closestDistanceSquared = distanceSquared(pixColor, solarized[0]); | ||
33 | for (int i = 1; i < 15; i++) { | ||
34 | float newDistanceSquared = distanceSquared(pixColor, solarized[i]); | ||
35 | if (newDistanceSquared < closestDistanceSquared) { | ||
36 | closest = i; | ||
37 | closestDistanceSquared = newDistanceSquared; | ||
38 | } | ||
39 | } | ||
40 | gl_FragColor = vec4(solarized[closest], 1.); | ||
41 | } | ||