Skip to content

Commit

Permalink
feat(template.mustache): change nullish coalescing operator lambda na…
Browse files Browse the repository at this point in the history
…me to `nc`
  • Loading branch information
loqusion committed Apr 8, 2024
1 parent bd58938 commit 3ff1647
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions shaders/blue-light-filter.glsl.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ precision highp float;
varying vec2 v_texcoord;
uniform sampler2D tex;

const float temperature = {{#d}}{{temperature}} ? 2600.0{{/d}};
const float temperatureStrength = {{#d}}{{temperatureStrength}} ? 1.0{{/d}};
const float temperature = {{#nc}}{{temperature}} ? 2600.0{{/nc}};
const float temperatureStrength = {{#nc}}{{temperatureStrength}} ? 1.0{{/nc}};

#define WithQuickAndDirtyLuminancePreservation
const float LuminancePreservationFactor = 1.0;
Expand Down
4 changes: 2 additions & 2 deletions shaders/color-filter.glsl.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ varying vec2 v_texcoord;
uniform sampler2D tex;

// Intensity of filter (1.0 - 0.0)
const float intensity = {{#d}}{{intensity}} ? 0.2{{/d}};
const float intensity = {{#nc}}{{intensity}} ? 0.2{{/nc}};

// Enum for color correction type
const int PROTANOPIA = 0;
const int DEUTERANOPIA = 1;
const int TRITANOPIA = 2;

// Color correction type
const int type = {{#d}}{{type}} ? PROTANOPIA{{/d}};
const int type = {{#nc}}{{type}} ? PROTANOPIA{{/nc}};

void main() {
vec4 pixColor = texture2D(tex, v_texcoord);
Expand Down
2 changes: 1 addition & 1 deletion src/hyprshade/template/mustache.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def nullish_coalesce(text: str, render: Callable[[str], str]):
raise ValueError("Mustache nullish coalesce operator is not valid.")


NULLISH_COALESCE_LAMBDA_NAME: Final = "d"
NULLISH_COALESCE_LAMBDA_NAME: Final = "nc"
DEFAULT_RENDER_DATA: Final = {NULLISH_COALESCE_LAMBDA_NAME: nullish_coalesce}


Expand Down

0 comments on commit 3ff1647

Please sign in to comment.