Displayer.SetPixel should use color.Color
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- go
- 領域
- embedded-iot
調査の方向性
Start by locating the Displayer interface and its SetPixel implementations across the drivers repository. Review how each device converts or handles color values, then assess the impact of changing the interface to accept color.Color. Done means the interface and affected drivers consistently support the proposed color input; the issue does not name specific files or tests.
索引モデルが issue の本文から書いたものです。
説明
I want to be able to do this:
display.FillRectangle(x, 5, 5, 5, color.White)
But beause Displayer.SetPixel takes color.RGBA, I must do this:
dispay.FillRectangle(x, 5, 5, 5, color.RGBAModel.Convert(color.White).(color.RGBA))
color.Color is meant to provide an interface for all colors:
type Color interface {
// RGBA returns the alpha-premultiplied red, green, blue and alpha values
// for the color. Each value ranges within [0, 0xffff], but is represented
// by a uint32 so that multiplying by a blend factor up to 0xffff will not
// overflow.
//
// An alpha-premultiplied color component c has been scaled by alpha (a),
// so has valid values 0 <= c <= a.
RGBA() (r, g, b, a uint32)
}
I know this is going to be painful, because so many things use it, but I propose Displayer be redefined as follows, so that it may use the color package as intended:
type Displayer interface {
// Size returns the current size of the display.
Size() (x, y int16)
// SetPixel modifies the internal buffer.
SetPixel(x, y int16, c color.Color)
// Display sends the buffer (if any) to the screen.
Display() error
}
It should then be up to each device implementing Displayer to decide how to handle the 16-bit color. Probably most of them will shift R, G, and B right by 8, and continue to ignore A.
Existing code (other than drivers) will not be impacted by this change, since color.RGBA already implements color.Color. If performance is a concern, type matching can be used to check whether c is a color.RGBA and avoid the bit shifts.
- 主要言語
- Go
- スター
- 756
- フォーク
- 251
- 平均マージ
- 7日 12時間
- マージ済み PR(30日)
- 8
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tinygo-org/drivers のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
tinygo-org/drivers#946 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
tinygo-org/drivers#927 ·
メンテナーはふだん 3 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
tinygo-org/drivers#901 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
tinygo-org/drivers#886 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
tinygo-org/drivers#877 ·
メンテナーはふだん 3 日以内に返信
tinygo-org/drivers の issue をすべて見る
似ている issue
-
release
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
github/gh-aw-mcpg#17603 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tinygo-org/tinygo#6727 ·
メンテナーはふだん 1 日以内に返信
-
help wanted
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
oras-project/oras-go#1827 ·
メンテナーはふだん 1 日以内に返信
-
docs: database/sql Sessions example never commits its batch, and its "Full Example" link is a 404オープンdocumentation
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
ClickHouse/clickhouse-go#2185 ·
メンテナーはふだん 1 日以内に返信
-
bug needs triage receiver/podman
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
open-telemetry/opentelemetry-collector-contrib#53700 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信