X Tutup
Skip to content

Add a tool option to the gradient tool to use a custom color gradient #170

@jbunke

Description

@jbunke

Currently, the gradient tool uses a simple dipolar gradient made up of the primary and secondary system colors.

New functionality

I want to add a tool option to the gradient tool that is displayed before the dither flag that lets the user choose whether to use the system colors or a custom gradient.

The tool options bar should look something like this:

1_3_0-gradient-tool-options-mockup

(Tool options bar in geometric mode follows)

Gradient colors configuration

The "gradient colors configuration" button should only be visible when the custom colors flag is checked. Clicking the button should bring up a dialog menu with a spectral diagram with color nodes attached to it.

  • Defaults:
    • By default, there should be two color nodes, one at 0% and one at 100%
    • 0% should be the primary color and 100% should be the secondary color
  • The user can add up to ten color nodes
  • Color nodes can be positioned along the spectrum at integer increments from 0 to 100, each separated by a minimum of 1
  • There must be at least two color nodes
  • The color nodes at 0 and 100 cannot be moved or removed
  • The default position of a newly added color node will be directly in between (rounding down in case of an odd-numbered gap) the last two color nodes. If the last two color nodes are separated by a gap of 1, the new color node attempts to insert itself in the preceding gap.
  • The initial color assigned to a new color node is the 50% linear interpolation value of the colors it is sandwiched between.

Tool behaviour changes

Existing tool behaviour will have to be refactored, as it is currently a mere lerp between color A and color B. Now, for some value between 0.0 and 1.0, the algorithm will have to determine (1) its bounding colors, (2) the bound values, and (3) the local c value, in order to calculate the gradient color or whether to use A or B to dither the pixel.

Metadata

Metadata

Assignees

Projects

Status

Planned

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup