diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index f0c94ccd..f13a8cec 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -56,6 +56,7 @@ export default defineConfig({ { text: 'Scanline', link: '/guide/pmndrs/scanline' }, { text: 'Pixelation', link: '/guide/pmndrs/pixelation' }, { text: 'Vignette', link: '/guide/pmndrs/vignette' }, + { text: 'Hue & Saturation', link: '/guide/pmndrs/hue-saturation' }, ], }, { diff --git a/docs/.vitepress/theme/components/pmdrs/HueSaturationDemo.vue b/docs/.vitepress/theme/components/pmdrs/HueSaturationDemo.vue new file mode 100644 index 00000000..ed365cc7 --- /dev/null +++ b/docs/.vitepress/theme/components/pmdrs/HueSaturationDemo.vue @@ -0,0 +1,57 @@ + + + diff --git a/docs/components.d.ts b/docs/components.d.ts index 33ae63e7..f948911e 100644 --- a/docs/components.d.ts +++ b/docs/components.d.ts @@ -15,6 +15,8 @@ declare module 'vue' { GlitchDemo: typeof import('./.vitepress/theme/components/pmdrs/GlitchDemo.vue')['default'] GlitchThreeDemo: typeof import('./.vitepress/theme/components/three/GlitchThreeDemo.vue')['default'] HalftoneThreeDemo: typeof import('./.vitepress/theme/components/three/HalftoneThreeDemo.vue')['default'] + HueSaturation: typeof import('./.vitepress/theme/components/pmdrs/HueSaturationDemo.vue')['default'] + HueSaturationDemo: typeof import('./.vitepress/theme/components/pmdrs/HueSaturationDemo.vue')['default'] LoveVueThreeJS: typeof import('./.vitepress/theme/components/LoveVueThreeJS.vue')['default'] NoiseDemo: typeof import('./.vitepress/theme/components/pmdrs/NoiseDemo.vue')['default'] OutlineDemo: typeof import('./.vitepress/theme/components/pmdrs/OutlineDemo.vue')['default'] diff --git a/docs/guide/pmndrs/hue-saturation.md b/docs/guide/pmndrs/hue-saturation.md new file mode 100644 index 00000000..249ab335 --- /dev/null +++ b/docs/guide/pmndrs/hue-saturation.md @@ -0,0 +1,60 @@ +# Hue & Saturation + + + + + +The `HueSaturation` effect is part of the [`postprocessing`](https://pmndrs.github.io/postprocessing/public/docs/class/src/effects/HueSaturationEffect.js~HueSaturationEffect.html) package. It allows you to adjust the hue and saturation of your scene, providing flexibility for color grading and artistic effects. + +## Usage + +The `` component is straightforward to use and provides customizable options to fine-tune the hue and saturation of your visuals. + +```vue{2,5-9,26-32} + + + +``` + +## Props + +| Prop | Description | Default | +| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | +| **saturation** | The saturation adjustment. A value of `0.0` results in grayscale, while `1.0` leaves saturation unchanged. Range: `[0.0, 1.0]`. | `0.0` | +| **hue** | The hue adjustment in radians. Values range from `[-π, π]` (or `[0, 2π]` for a full rotation). | `0.0` | +| **blendFunction** | Defines how the effect blends with the original scene. See the [`BlendFunction`](https://pmndrs.github.io/postprocessing/public/docs/variable/index.html#static-variable-BlendFunction) options. | `BlendFunction.SRC` | + +## Further Reading + +For more details, see the [HueSaturation documentation](https://pmndrs.github.io/postprocessing/public/docs/class/src/effects/HueSaturationEffect.js~HueSaturationEffect.html). diff --git a/playground/src/pages/postprocessing/hue-saturation.vue b/playground/src/pages/postprocessing/hue-saturation.vue new file mode 100644 index 00000000..b9c5e09f --- /dev/null +++ b/playground/src/pages/postprocessing/hue-saturation.vue @@ -0,0 +1,56 @@ + + + diff --git a/playground/src/router.ts b/playground/src/router.ts index e067f607..984b80a7 100644 --- a/playground/src/router.ts +++ b/playground/src/router.ts @@ -35,6 +35,7 @@ export const postProcessingRoutes = [ makeRoute('Outline', '🔲', false), makeRoute('Glitch', '📺', false), makeRoute('Depth of Field', '📷', false), + makeRoute('Hue & Saturation', '📷', false), makeRoute('Pixelation', '👾', false), makeRoute('Bloom', '🌼', false), makeRoute('Noise', '📟', false), diff --git a/src/core/pmndrs/HueSaturationPmndrs.vue b/src/core/pmndrs/HueSaturationPmndrs.vue new file mode 100644 index 00000000..518dbb47 --- /dev/null +++ b/src/core/pmndrs/HueSaturationPmndrs.vue @@ -0,0 +1,48 @@ + diff --git a/src/core/pmndrs/index.ts b/src/core/pmndrs/index.ts index be5d2221..b9cc46f1 100644 --- a/src/core/pmndrs/index.ts +++ b/src/core/pmndrs/index.ts @@ -9,6 +9,7 @@ import NoisePmndrs, { type NoisePmndrsProps } from './NoisePmndrs.vue' import OutlinePmndrs, { type OutlinePmndrsProps } from './OutlinePmndrs.vue' import PixelationPmndrs, { type PixelationPmndrsProps } from './PixelationPmndrs.vue' import VignettePmndrs, { type VignettePmndrsProps } from './VignettePmndrs.vue' +import HueSaturationPmndrs, { type HueSaturationPmndrsProps } from './HueSaturationPmndrs.vue' import ScanlinePmndrs, { type ScanlinePmndrsProps } from './ScanlinePmndrs.vue' export { @@ -21,8 +22,8 @@ export { PixelationPmndrs, useEffectPmndrs, VignettePmndrs, + HueSaturationPmndrs, ScanlinePmndrs, - BloomPmndrsProps, DepthOfFieldPmndrsProps, EffectComposerPmndrsProps, @@ -31,5 +32,6 @@ export { OutlinePmndrsProps, PixelationPmndrsProps, VignettePmndrsProps, + HueSaturationPmndrsProps, ScanlinePmndrsProps, }