# MatrixRampMixin

Auto-generated from the @jbrowse/mobx-state-tree model in the source — see the [developer guide](https://jbrowse.org/jb2/docs/developer_guide/) for concepts. Built into JBrowse core. [View source](https://github.com/GMOD/jbrowse-components/blob/main/packages/display-kit/src/MatrixRampMixin.ts).

A matrix display's `encoding.color` as it paints: the painted field through its preset's ramp (`colorEncoding`), that ramp's scheme, direction and 256-entry table (`colorScheme`, `colorReverse`, `colorRamp`), and the scheme pick (`setColorScheme`). A display that may paint a field other than the written one, because the file could not serve it, answers `paintedColorField`. The domain stays the display's: one follows the loaded values, another spans its statistic's fixed range

## Getters

| Member | Description |
| --- | --- |
| **paintedColorField**<br><code>F</code> | Overridable hook: the field the loaded cells are, the written one unless the display overrides it with what the file served. |
| **colorEncoding**<br><code>MatrixColorEncoding&lt;F&gt;</code> | The color channel under the painted field's preset, with an unset `scale.reverse` turning round a scheme dark at its low end, since an unpainted cell is the page behind the matrix. The preset's scheme fills whichever continuous scale is written: `withPreset` drops a preset whose scale differs, which would leave the Log toggle painting no field's scheme. |
| **colorScaleType**<br><code>"linear" &#124; "log" &#124; "symlog"</code> |  |
| **colorScheme**<br><code>"blues" &#124; "cividis" &#124; "fall" &#124; "inferno" &#124; "juicebox" &#124; "magma" &#124; "purpleorange" &#124; "redblue" &#124; "redgreyblue" &#124; "reds" &#124; "redyellowblue" &#124; "viridis"</code> |  |
| **colorReverse**<br><code>boolean</code> | `scale.reverse`, or where unset whether the scheme runs dark at its low end. |
| **colorRamp**<br><code>Uint8Array&lt;ArrayBufferLike&gt;</code> | The ramp's 256 entries: the GPU's texture, the Canvas2D fill and the legend read this one table. It reads `colorScheme` and `colorReverse` rather than the encoding, so a domain edit re-uploads no texture. |

## Actions

| Member | Description |
| --- | --- |
| **setColorScheme**<br><code>(scheme: "blues" &#124; "cividis" &#124; "fall" &#124; "inferno" &#124; "juicebox" &#124; "magma" &#124; "purpleorange" &#124; "redblue" &#124; "redgreyblue" &#124; "reds" &#124; "redyellowblue" &#124; "viridis") =&gt; void</code> | The scheme, with `reverse` back to unset so it follows the scheme. The painted field's own scheme writes `scheme` unset, so it keeps following the field. |

