Skip to content

Allow color initialization from string with color space prefix #4

Description

@cgcostume

Moved from webgl-operate

Implement parser for color initialization/creation, e.g.,

  • Color.parse('lab(0.1, 0.1, 0.1)');
  • Color.parse('rgb(0.1, 0.1, 0.1)');
  • Color.parse('hsl(0.1, 0.1, 0.1)');
  • Color.parse('cmyk(0.1, 0.1, 0.1, 0.1)');
  • Color.parse('rgba(0.1, 0.1, 0.1, 0.1)');
  • etc

This could be also useful (among other things), e.g., data attributes of canvases in haeley-canvas <canvas data-clear-color='laba(0.1, 0.1, 0.1, 1.0)'> ... currently only parsing of a 4-tuple is supported and interpreted as rgba (in Canvas.constructor).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions