darkly 0.5.0

A GPU-native paint engine on wgpu: brushes, layers, blend modes, masks, selections, and undo.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::gpu::blend_mode::BlendModeRegistration;

pub fn register() -> BlendModeRegistration {
    BlendModeRegistration {
        type_id: "hard_light",
        display_name: "Hard Light",
        category: "Contrast",
        gpu_value: 10,
        wgsl_math: "\
            let lo = 2.0 * fg.rgb * bg.rgb; \
            let hi = 1.0 - 2.0 * (1.0 - fg.rgb) * (1.0 - bg.rgb); \
            Cs = select(hi, lo, fg.rgb <= vec3f(0.5));",
    }
}