Skip to content

Custom colour palette functionality/documentation #59

@nickhenden

Description

@nickhenden

Update (05/02/2026): Agreed with R package subgroup to go with Option 2 (documentation), at least for now. See comments for more info.

Consider adding functionality and/or documentation on how to use non-Analysis Function colour palettes.

We want to encourage users to use the Analysis Function colour palettes where possible. However, we acknowledge that there are times when custom colour palettes are required. We need to decide whether to provide specific functionality to help users create custom palettes, or if we show users how to do it via the documentation.

Option 1: Added functionality

The abandoned PR #20 includes two functions that may be useful:

  • create_colormap_from_stops takes a list of gradient colour stops and turns it into a colormap object
  • sample_colors_from_cmap extracts a specified number of colours from a colourmap

Example use case: to generate a sequential colour palette with more than three colours (the AF palette only has 3).

Option 2: Documentation

Instead we could include example code for how to change colour palettes in the cookbook. We could include a warning that users should use custom colour palettes with caution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions