# Custom controls

**URL:** <https://forum.electra.one/t/custom-controls/3634>\
**Category:** Developers\
**Created:** [April 7, 2025, 12:54pm UTC](https://forum.electra.one/t/custom-controls/3634 "2025-04-07T12:54:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/jhh/32/951_2.png) [@jhh](https://forum.electra.one/u/jhh)\
**Post date:** [April 7, 2025, 12:54pm UTC](https://forum.electra.one/t/custom-controls/3634/1 "2025-04-07T12:54:17Z")

</div>

Starting playing around with the new ‘Custom’ control.

Would be nice if the preset format would allow to define the paintCallback (like it does already for the formatter and function), so these do not have to be set in the preset.onLoad() function. Seems more natural. And would it be possible/sensible to define default touch/pot callbacks

Noticed a bug in the documentation for graphics.setColor():

> **[Preset Lua extension | Electra One Documentation](https://docs.electra.one/developers/luaext.html#graphics)**

it takes a 3 byte RGB value, not a two byte RGB565 value.

---

<div class="post-metadata">

**Author:** ![jhh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/jhh/32/951_2.png) [@jhh](https://forum.electra.one/u/jhh)\
**Post date:** [April 7, 2025, 1:23pm UTC](https://forum.electra.one/t/custom-controls/3634/2 "2025-04-07T13:23:26Z")

</div>

And am I correctly observing that you cannot override the way standard controls (like a toggle) are drawn by setting their `setPaintCallback`?

---

<div class="post-metadata">

**Author:** ![martin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/martin/32/145_2.png) [@martin](https://forum.electra.one/u/martin)\
**Post date:** [April 7, 2025, 5:18pm UTC](https://forum.electra.one/t/custom-controls/3634/3 "2025-04-07T17:18:11Z")

</div>

yes, that is correct. You can override, or rather define, the paint and touch callbacks for custom controls only. I didn’t want to ‘infect’ the standard controls with Lua overrides. If there is a demand for it it can be done in the future.
