Skip to content

fix: consolidate hexToRgb functions in tests #1802

@heyMP

Description

@heyMP

We have many instances of the hexToRgb function throughout our tests. We should consolidate them into a utils directory.

const hexToRgb = hex => {
  const [, r, g, b] = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/.exec(hex);
    return [
        parseInt(r, 16),
        parseInt(g, 16),
        parseInt(b, 16)
      ];
};

Proposal

We should add this to PFE 2.0 since we are migrating all of our tests to web-test-runner.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions