Skip to content

Show the colour of a shape in the shape library - #717

Open
crazykay wants to merge 1 commit into
henmedia:mainfrom
crazykay:shape-library-default-colors
Open

crazykay wants to merge 1 commit into
henmedia:mainfrom
crazykay:shape-library-default-colors

Conversation

@crazykay

Copy link
Copy Markdown

The shape library's pictures were grey, so the list said nothing about the colour a shape would land in. Every library entry now wears the colour a new shape of its kind starts with: the catalogue's own, or the colour saved for that kind under Shape defaults.

  • The grey render keeps its shading: a colour layer, masked by the picture's outline, multiplies over it.

    • It works in the normal list, in the icon-only size and in light, dark and graphite themes.
    • shapeAssetColor() in shapeCatalog.ts is the single rule and is shared with makeShapeFromAsset(), so the picture cannot drift from the body that is added.
    • Unit tests in shapeCatalog.test.ts; the graphite theme stylesheet was regenerated.
      Validation:
  • npm test: 2806/2806

    • npm run typecheck
    • npm run export: static export succeeds
    • Checked in the dev server in light, dark (graphite) and icon-only menus; added a box from the list and confirmed its colour matches the tinted picture.

The library's pictures were grey, so the list did not say what colour a shape would land in. Each entry now wears the colour a new shape of its kind starts with: the catalogue's own, or the colour saved in the shape defaults.

The grey render keeps its shading. A colour layer masked by the picture outlines multiplies over it, in the list, in the icon-only size and in both themes. shapeAssetColor() is the single rule, shared with makeShapeFromAsset(), and tested in shapeCatalog.test.ts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant