Skip to content

Commit

Permalink
Update OKLAB and OKLCH graphs
Browse files Browse the repository at this point in the history
Removed `libcosmic` `rev` key
  • Loading branch information
PixelDoted committed Jun 12, 2024
1 parent 7d02e44 commit c7301ea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ rust-embed = "8.3.0"

[dependencies.libcosmic]
git = "https://github.com/pop-os/libcosmic.git"
rev = "2fc4184"
default-features = false
features = ["dbus-config", "tokio", "winit", "wgpu"]

Expand Down
2 changes: 1 addition & 1 deletion src/shaders/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<T: bytemuck::Pod, const ID: u32> ShaderPipeline<T, ID> {
label: Some("shader uniform bind group layout"),
entries: &[wgpu::BindGroupLayoutEntry {
binding: 0,
visibility: wgpu::ShaderStages::VERTEX_FRAGMENT,
visibility: wgpu::ShaderStages::FRAGMENT,
ty: wgpu::BindingType::Buffer {
ty: wgpu::BufferBindingType::Uniform,
has_dynamic_offset: false,
Expand Down
10 changes: 4 additions & 6 deletions src/shaders/oklab.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ fn fs_main(
var rgb = vec3<f32>(0.0);
switch oklab.mode {
case MODE_LIGHTNESS: {
let green_red = uv.y - 0.5;
let lightness = uv.x;

rgb = oklab_to_rgb(lightness, green_red, oklab.blue_yellow);

rgb = oklab_to_rgb(lightness, oklab.green_red, oklab.blue_yellow);
}
case MODE_GREEN_RED: {
let green_red = uv.y - 0.5;
let blue_yellow = uv.x - 0.5;
let lightness = uv.y;
let green_red = uv.x - 0.5;

rgb = oklab_to_rgb(oklab.lightness, green_red, blue_yellow);
rgb = oklab_to_rgb(lightness, green_red, oklab.blue_yellow);
}
case MODE_BLUE_YELLOW: {
let lightness = uv.y;
Expand Down
4 changes: 2 additions & 2 deletions src/shaders/oklch.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ fn fs_main(
rgb = oklch_to_rgb(lightness, chroma, oklch.hue);
}
case MODE_CHROMA: {
let chroma = uv.y * 0.37;
let hue = uv.x * 360.0;
let chroma = uv.x * 0.37;
let hue = uv.y * 360.0;

rgb = oklch_to_rgb(oklch.lightness, chroma, hue);
}
Expand Down

0 comments on commit c7301ea

Please sign in to comment.