Skip to content

Support methods on structs (impl blocks)#800

Draft
sharkdp wants to merge 2 commits intomainfrom
impl-blocks
Draft

Support methods on structs (impl blocks)#800
sharkdp wants to merge 2 commits intomainfrom
impl-blocks

Conversation

@sharkdp
Copy link
Copy Markdown
Owner

@sharkdp sharkdp commented Jan 16, 2026

No description provided.

Comment on lines -531 to -545
### `color_rgb`
Convert a color to its RGB representation.

```nbt
fn color_rgb(color: Color) -> String
```

!!! example "Example"
```nbt
use extra::color
cyan -> color_rgb

= "rgb(0, 255, 255)" [String]
```
[:material-play-circle: Run this example](https://numbat.dev/?q=use%20extra%3A%3Acolor%0Acyan%20%2D%3E%20color%5Frgb){ .md-button }
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Todo: document struct methods

@sharkdp sharkdp mentioned this pull request Mar 2, 2026
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