Forum Archive

Is it possible to create full color ui.Buttons?

ccc

Buttons are blue by default.

import ui
view = ui.View()
view.add_subview(ui.Button(image=ui.Image.named('Girl')))
view.present()

It would be cool to show the image in full color.

brumm

You can get a full color image by overwriting the draw methode.

    def draw(self):
        img = ui.Image.named('Girl')
        img.draw()

SpecialButton

omz

I would recommend to use the Image.with_rendering_mode method instead:

import ui
img = ui.Image.named('Girl').with_rendering_mode(ui.RENDERING_MODE_ORIGINAL)
view = ui.View()
button = ui.Button(image=img)
view.add_subview(button)
view.present()