# Palette Gradient Brushes

The following commands feature brushes for creating gradients.

***

### `//ezbr` <mark style="color:orange;">`gradient`</mark>

<details>

<summary><mark style="color:blue;">Gradient Brush</mark></summary>

**` //ezbr gradient`` `` `**<mark style="color:orange;">**`<palette> [radius] [interpolation] [bleed] [-avw] [-n <noise>] [-z <scale>] [-d <distanceFunction>]`**</mark>

The `gradient` brush allows you to first define a plane by selecting 2 points, you can then paint with your gradient with blocks chosen based on distance along this plane.

<mark style="color:blue;">**Left Click**</mark>**&#x20;to start a plane at your target block**\ <mark style="color:blue;">**Sneak + Left Click**</mark>**&#x20;to start a plane at the player position**\ <mark style="color:blue;">**Right Click**</mark>**&#x20;to set the end of the plane at your target block OR paint palette blocks if the plane is set**\ <mark style="color:blue;">**Sneak + Right Click**</mark>**&#x20;to set the end of the plane at the player position OR paint palette blocks if the plane is set**\ <mark style="color:blue;">**Swap Hands**</mark>**&#x20;(Default F key) to toggle between GLOBAL and PER\_ITEM active gradients**

* <mark style="color:orange;">**Palette**</mark>: Specifies the palette to use for the gradient.
* <mark style="color:orange;">**Radius**</mark> (Default: 8): Sets the radius of the brush.
* <mark style="color:orange;">**Interpolation**</mark> (Default: NONE): Determines the type of interpolation used in the gradient transition.
* <mark style="color:orange;">**Bleed**</mark> (Default: 0.5): Adjusts the strength of interpolation, with a normal range from 0 to 1.
* <mark style="color:orange;">**`-a`**</mark>: When activated, the gradient is allowed to replace air blocks.
* <mark style="color:orange;">**`-v`**</mark>: Deactivates WorldEditCUI integration.
* <mark style="color:orange;">`-w`</mark>: Try to texture shaping blocks (slabs, stairs, etc.) with the closest existing material.
* <mark style="color:orange;">**`-n <noise>`**</mark> (Default: `White()`): Adds an underlying noise field to the gradient effect.
* <mark style="color:orange;">**`-z <scale>`**</mark> (Default: 1): Modifies the scale of the noise.
* <mark style="color:orange;">**`-d <distanceFunction>`**</mark> (Default: NONE): Sets the distance mode changing the brush to work based on distance from the initial block with the given distance function.

</details>

***

### `//ezbr` <mark style="color:orange;">`gradientstroke`</mark>

<details>

<summary><mark style="color:blue;">Gradient Stroke Brush</mark></summary>

**` //ezbr gradientstroke`` `` `**<mark style="color:orange;">**`<palette> [radius] [interpolation] [bleed] [-advwx] [-n <noise>] [-z <scale>]`**</mark>

The `gradientstroke` brush allows for gradient application along a path (stroke) defined by selecting points.

<mark style="color:blue;">**Left Click**</mark>**&#x20;to add points**\ <mark style="color:blue;">**Sneak + Left Click**</mark>**&#x20;to remove the last point**\ <mark style="color:blue;">**Right Click**</mark>**&#x20;to confirm & place the gradient stroke**\ <mark style="color:blue;">**Sneak + Right Click**</mark>**&#x20;to clear all points**\ <mark style="color:blue;">**Swap Hands**</mark>**&#x20;(Default F key) to toggle between GLOBAL and PER\_ITEM active gradients**

* <mark style="color:orange;">**Palette**</mark>: Specifies the block pattern for the gradient.
* <mark style="color:orange;">**Radius**</mark> (Default: 8): Sets the radius of the brush.
* <mark style="color:orange;">**Interpolation**</mark> (Default: LINEAR): Determines the type of interpolation used in the gradient transition.
* <mark style="color:orange;">**Bleed**</mark> (Default: 0.5): Adjusts the strength of interpolation, with a normal range from 0 to 1.
* <mark style="color:orange;">**`-a`**</mark>: When activated, allows the gradient to replace air blocks.
* <mark style="color:orange;">**`-d`**</mark>: Activates the 'distance to center' mode which applies the gradient based on distance to the middle of the stroke line instead of distance along the stroke.
* <mark style="color:orange;">**`-v`**</mark>: Deactivates WorldEditCUI integration.
* <mark style="color:orange;">`-w`</mark>: Try to texture shaping blocks (slabs, stairs, etc.) with the closest existing material.
* <mark style="color:orange;">**`-x`**</mark>: Clears the brush's path after every placed stroke.
* <mark style="color:orange;">**`-n <noise>`**</mark> (Default: `White()`): Adds an underlying noise field to the gradient effect.
* <mark style="color:orange;">**`-z <scale>`**</mark> (Default: 1): Modifies the scale of the noise.

</details>

***

## Gradient Parameters

There are a few parameters to creating a gradient worth explaining.

### Bleed

First off, the <mark style="color:orange;">**`bleed`**</mark> parameter.

![](https://62542430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmwyNbIIrWCkyIco2qJ9j%2Fuploads%2Fgit-blob-40f5cd90087ef2c78c423a54a913acf342d73409%2FGradientInterpolationTapered2.gif?alt=media)

The bleed parameter determines how much the colors bleed into each other.

### Noise

The pattern of how this bleeding takes place can be determined by <mark style="color:orange;">**`noise`**</mark>. The GIF above was using White noise (`-n White`), while the following GIFs use Perlin noise (`-n Perlin(Freq:0.25)`)

![](https://62542430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmwyNbIIrWCkyIco2qJ9j%2Fuploads%2Fgit-blob-fdb3525cd7358d4e62d4efe1dddecf6e0fe05987%2FGradientInterpolationTapered.gif?alt=media)

#### You can also put in any noise. Here are a few more examples:

**`-n Perlin(Freq:0.25)`**

![](https://62542430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmwyNbIIrWCkyIco2qJ9j%2Fuploads%2Fgit-blob-db7124c532f5bc8b6ac27ce537bf833603a4f0c2%2FGradientInterpolationNoise_example1.png?alt=media)

**`-n Cellular(Freq:0.15)`**

![](https://62542430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmwyNbIIrWCkyIco2qJ9j%2Fuploads%2Fgit-blob-1e90108b272026438da4ca5deb82b4eb66d5d25b%2FGradientInterpolationNoise_example3.png?alt=media)

**`-n @@ridged(Freq:0.15)`**

![](https://62542430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmwyNbIIrWCkyIco2qJ9j%2Fuploads%2Fgit-blob-c4e5f3af1e103f4816a2fe7d4e23fc36001667e9%2FGradientInterpolationNoise_example2.png?alt=media)

**`-n Shard(Freq:0.15)`**

![](https://62542430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmwyNbIIrWCkyIco2qJ9j%2Fuploads%2Fgit-blob-3fac181f3493c0b04b73a02e521faa71bf6e0565%2FGradientInterpolationNoise_example4.png?alt=media)

### Interpolation Mode

In the following, we compare the five different <mark style="color:orange;">**`interpolation modes`**</mark> of applying the noise to the gradient. The GIFs go through increasing and decreasing bleed values between 0 and 1.

*The blue square's top and bottom show where the gradient starts and ends*

#### NONE

No interpolation is applied.

![](https://62542430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmwyNbIIrWCkyIco2qJ9j%2Fuploads%2Fgit-blob-212859f5d6836ea4ab56e5362efc9ba1bf002f27%2FGradientInterpolationNone.png?alt=media)

#### LINEAR

The noise is applied with a constant factor throughout the entire gradient. Because of that, the gradient is "clipping" outside our two selected positions.

![](https://62542430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmwyNbIIrWCkyIco2qJ9j%2Fuploads%2Fgit-blob-540e522c65bb95d7a11eaa8c860936b18e63abbe%2FGradientInterpolationLinear.gif?alt=media)

#### TAPERED

Applies the noise strongest in the middle of the gradient and tapers off towards the start and end to avoid "clipping" outside of the given positions.

![](https://62542430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmwyNbIIrWCkyIco2qJ9j%2Fuploads%2Fgit-blob-fdb3525cd7358d4e62d4efe1dddecf6e0fe05987%2FGradientInterpolationTapered.gif?alt=media)

#### BEZIER

Uses Bezier interpolation to apply the noise more softly and smoothly. Breaks for a bleed value of >1.

![](https://62542430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmwyNbIIrWCkyIco2qJ9j%2Fuploads%2Fgit-blob-df1ee0f1842fc60c7bb61c815d93eb44df4dc747%2FGradientInterpolationBezier.gif?alt=media)

#### SIN

![](https://62542430-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmwyNbIIrWCkyIco2qJ9j%2Fuploads%2Fgit-blob-71de92f790b03175e64fb1af992baf48c841ddd1%2FGradientInterpolationSin.gif?alt=media)
