Add-On Documentation
  • Preparing search index...
  • The search index is not available
8Crafter's Server Utilities API
  • 8Crafter's Server Utilities API
  • Globals
  • modules
  • colorCore
  • createPerceptuallyUniformScale

Function createPerceptuallyUniformScale

  • createPerceptuallyUniformScale(
        startColor: Globals.modules.colorCore.Color,
        endColor: Globals.modules.colorCore.Color,
        steps: number,
    ): Globals.modules.colorCore.Color[]

    Creates a perceptually uniform sequential color scale.

    This function generates a color scale where the perceived difference between each step is uniform. It's crucial for accurate representation of data in visualizations.

    Parameters

    • startColor: Globals.modules.colorCore.Color

      The starting color of the scale.

    • endColor: Globals.modules.colorCore.Color

      The ending color of the scale.

    • steps: number

      The number of colors to generate in the scale.

    Returns Globals.modules.colorCore.Color[]

    An array of Color objects representing the perceptually uniform sequential scale.

    Example

    const uniformScale = createPerceptuallyUniformScale(
    new Color('#ffffcc'), // Light yellow
    new Color('#800026'), // Dark red
    7
    );
    // Returns an array of 7 Color objects with perceptually uniform steps between light yellow and dark red
    • Defined in ../../../../AppData/Roaming/.minecraft_bedrock/installations/Main Release/packageData/development_behavior_packs/DebugSticksAndScreens/node_modules/color-core/dist/scales/components/perceptually-uniform-scale.d.ts:21

Settings

Member Visibility
Add-On Documentation
8Crafter's Server Utilities API
  • Loading...

Generated using TypeDoc