Skip to content

Conversation

@Brooooooklyn
Copy link
Owner

per w3c specs

Copilot AI review requested due to automatic review settings December 15, 2025 03:01
Copy link
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the default black color string representation from the short 3-digit hex format #000 to the full 6-digit W3C-compliant format #000000. This change ensures consistency with W3C specifications for CSS color values and aligns with existing practices in other parts of the codebase (e.g., src/ctx.rs and src/state.rs already use #000000).

  • Updates default Pattern color string to use #000000
  • Updates CanvasElement fillStyle and strokeStyle initialization to use #000000
  • Updates SVGCanvas fillStyle and strokeStyle initialization to use #000000

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/pattern.rs Updates the Default implementation for Pattern to use #000000 instead of #000 for the color string representation
src/lib.rs Updates CanvasElement and SVGCanvas initialization to set fillStyle and strokeStyle hidden properties to #000000 instead of #000

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Brooooooklyn Brooooooklyn force-pushed the 12-15-fix_initial_black_color_string_should_be_000000_rather_than_000_ branch from 64f27d7 to 9738d89 Compare December 15, 2025 04:04
@Brooooooklyn Brooooooklyn merged commit c45020a into main Dec 15, 2025
37 checks passed
@Brooooooklyn Brooooooklyn deleted the 12-15-fix_initial_black_color_string_should_be_000000_rather_than_000_ branch December 15, 2025 04:15
@yisibl
Copy link
Collaborator

yisibl commented Dec 15, 2025

https://html.spec.whatwg.org/multipage/canvas.html#canvasfillstrokestyles

interface mixin CanvasFillStrokeStyles {
  // colors and styles (see also the CanvasPathDrawingStyles and CanvasTextDrawingStyles interfaces)
  attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (default black)
  attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (default black)
  CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
  CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
  CanvasGradient createConicGradient(double startAngle, double x, double y);
  CanvasPattern? createPattern(CanvasImageSource image, [LegacyNullToEmptyString] DOMString repetition);

};

@Brooooooklyn
Copy link
Owner Author

CleanShot 2025-12-15 at 23 19 00@2x

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.

3 participants