Skip to content

Color binding doesn't support alpha for hex strings missing an alpha portion #626

Description

@rcoopr

When adding a binding with an initial value of a hex string with 3 or 6 digits (no alpha portion), the controller does not add an alpha slider.

const PARAMS = {
  tint: '#ff0',
};

pane.addBinding(PARAMS, 'tint', {
  view: 'color',
  color: { alpha: true },
});

I would expect declaring { alpha: true } to always add a supporting alpha slider. As a workaround, you can add the alpha portion to the hex string.

input has alpha slider
'#fff'
'#ffffff'
'#fffc'
'#ffffffcc'
0xfff
0xffffff

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions