Skip to content

feat(stdlib): add colorsys module — color space conversions - #762

Closed
antonsynd with Copilot wants to merge 3 commits into
mainlinefrom
copilot/feat-stdlib-add-colorsys-module
Closed

feat(stdlib): add colorsys module — color space conversions#762
antonsynd with Copilot wants to merge 3 commits into
mainlinefrom
copilot/feat-stdlib-add-colorsys-module

Conversation

Copilot AI commented May 29, 2026

Copy link
Copy Markdown
Contributor

Adds a colorsys module implementing RGB↔HSV, RGB↔HLS, and RGB↔YIQ conversions, matching Python's colorsys API exactly (float values in [0.0, 1.0], hue as fraction not degrees).

import colorsys

h, s, v = colorsys.rgb_to_hsv(0.2, 0.4, 0.6)
r, g, b = colorsys.hsv_to_rgb(h, s, v)

Changes

  • New module: src/Sharpy.Stdlib/Colorsys/ with __Init__.cs, Colorsys.cs (6 pure functions, ~200 LOC)
  • Spy source: src/Sharpy.Stdlib/spy/colorsys_module.spy
  • Per-module csproj: modules/Sharpy.Stdlib.Colorsys.csproj
  • Compiler registration: Added colorsysColorsysModule to StdlibClassNameOverrides in RoslynEmitter.CompilationUnit.cs
  • Test expectation: Added colorsys_module to NativeStdlibCompilationTests.ExpectedModules
  • Integration test: stdlib_colorsys.spy covering all 6 functions, roundtrips, and edge cases (black, white, pure colors)
  • Docs: docs/stdlib/colorsys.md

Copilot AI changed the title [WIP] Add colorsys module for color space conversions feat(stdlib): add colorsys module — color space conversions May 29, 2026
Copilot AI requested a review from antonsynd May 29, 2026 04:39
@antonsynd
antonsynd requested a review from Copilot May 29, 2026 04:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@antonsynd

Copy link
Copy Markdown
Owner

Superseded by consolidated implementation in ce6a757 on dev branch. Issue #758 closed.

@antonsynd antonsynd closed this Jun 1, 2026
@antonsynd
antonsynd deleted the copilot/feat-stdlib-add-colorsys-module branch June 1, 2026 15:10
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.

feat(stdlib): add colorsys module — color space conversions

3 participants