Skip to content

Commit

Permalink
remove unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasp committed Apr 13, 2021
1 parent 0284283 commit 9d0d491
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/components/src/color-palette/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ Whether the palette should have a clearing button or not.
- Required: No
- Default: true

### disableAlpha

Whether the custom color picker allows the selection of alpha values. Only relevant, when
`disableCustomColors` is false. If alpha is enabled, the returned color format will be rgba
instead of hex.

- Type: `Boolean`
- Required: No
- Default: true


## Usage
```jsx
Expand Down
13 changes: 13 additions & 0 deletions packages/components/src/color-palette/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,16 @@ export const withKnobs = () => {

return <ColorPaletteWithState colors={ colors } />;
};

export const alphaEnabled = () => {
const colors = [
object( 'Red', { name: 'red transparent', color: '#f00a' } ),
object( 'White', { name: 'white transparent', color: '#fff9' } ),
object( 'Blue', {
name: 'blue transparent',
color: 'rgba(0, 0, 255, 0.5)',
} ),
];

return <ColorPaletteWithState colors={ colors } disableAlpha={ false } />;
};

0 comments on commit 9d0d491

Please sign in to comment.