Skip to content

ebiten: ColorScale.Set(r, g, b, a float32) #3370

@erexo

Description

@erexo

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • PlayStation 5
  • Xbox
  • Web Browsers

What feature would you like to be added?

Usually when I deal with ColorScale in the engine, I'd like to change the color to be exactly as my desired color.Color.

Would it be possible to add

func (c *ColorScale) Set(r, g, b, a float32) {
	c.r_1 = r - 1
	c.g_1 = g - 1
	c.b_1 = b - 1
	c.a_1 = a - 1
}

and/or

func (c *ColorScale) SetWithColor(clr color.Color) {
	cr, cg, cb, ca := clr.RGBA()
	c.Set(float32(cr)/0xffff, float32(cg)/0xffff, float32(cb)/0xffff, float32(ca)/0xffff)
}

functions?

Why is this needed?

ease of use, instead of calling SetR/SetG/SetB/SetA separately

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions