Log In  

Cart #colours-9 | 2024-05-03 | Embed ▽ | License: CC4-BY-NC-SA
9

Colour Reference

A simple and small colour reference utility intended to be ran as a widget, but can still be ran windowed.

Widget install instructions

To add to your tooltray as a widget add the following line to the /appdata/system/startup.lua

create_process("/filepath/to/Colours.p64",
{
    window_attribs = {workspace = "tooltray", x=0, y=0},
})

change "/filepath/to/Colours.p64" to wherever you save the cart on your system.
I would recommend saving it as /appdata/tooltray/Colours.p64

Customisation

When ran as window the look of the app can be changed via the hamburger menu. To apply the same level of customisation when ran as a widget you can use the following arguments to do so:

  • UseDarkText - Instead of the default way to render
    the text colour on light coloured cells, it will
    use a single darker colour for all light coloured cells.

  • Vertical - Rotates the orientation to be vertical

  • BigFont - use the standard Picotron font rather than
    the smaller Pico 8 font that this app uses by default.

(For the following options, replace # with a number)

  • XSize=# - Specify how wide you want the cells to be.
    Default value is 9, 2 pixels are added when in BigFont
    mode. 9 should be considered the smallest, otherwise
    the font won't align.

  • PaddingSize=# - Specify the extra space in the middle
    'trough' of the palette. Default is 2. When in vertical
    windowed mode, if the overall width of the palette is
    less than 32, the padding will be increased to
    accommodate. This limitation is ignored when used as a
    Widget.

example of create_process command with args:

create_process("/appdata/tooltray/Colours.p64",
{
  window_attribs = {workspace = "tooltray", x=0, y=0},
  argv = {"UseDarkText", "PaddingSize=4"}
})

The order of the args does not matter

Changelog:

v2.3

  • Implemented parsing of args for customising the look of the app when installed as a widget.
  • removed un-needed files from the cart

v2.2

  • Reimplemented the original default (larger) font version. Changeable via the Switch Font option in the hamburger menu.

v2.1

  • Fixed an issue with the padding of the vertical mode persisting when reverting back to horizontal.

v2.0

  • Added Vertical mode - accessed in windowed mode via the Change Orientation option in the hamburger menu. I imagine this will be useful if using a Windowed editor like SLATE rather than the standard fullscreen one.
  • Exposed option to change the way the colours over the light colours are done with the Dark Text Toggle in the hambruger menu (I will make this an arg at some point so it can also be done for when it's a Widget).

v1.3

  • fixed bug where window was still resizeable (thanks OniriCorpe) (somehow this fix wasn't saved to 1.2)

v1.2

  • cleaned up some code, removed previous now unused experiments etc.
  • added comments to code in case people use the code as reference or learning
  • added Widget instructions (same file you can see in cart image) into the cart itself

v1.1

  • Changed the font to the Pico 8 font to slim it down a bunch more.
P#147325 2024-04-25 20:33 ( Edited 2024-05-03 10:55)

1

Looks cool. I followed the instructions however and get the following error when rebooting Picotron:

could not include /appdata/tooltray/Colours.p64/main.lua

Perhaps I installed it incorrectly? I used "load #colours-0" then Save File As to the /appdata/tooltray folder.

P#147343 2024-04-26 01:59

Just /appdata/tooltray/Colours.p64 should suffice. It's a cart so you don't have to point to the lua file within

P#147357 2024-04-26 06:23
1

This is pretty cool and I'm going to add it to my widgets!

I'm not a lawyer but I think that saying "This cart does not have a license" actually means that every right is reserved to you and no modifications can be done

I think you may want The Unlicense if you don't care about attribution and want to let anyone do anything, or CC4-BY-NC-SA if you want the standard one used in here, according to the terms of use

I'm saying this because I'd like to be able to use this without running into licensing problems

P#147424 2024-04-27 11:18

I guess just to make it simple I'll just add a license. I was under the impression that no license would've technically been more freeing. But I'm guessing there's some legal mumbo jumbo by default that technically suits otherwise or something?

P#147451 2024-04-27 18:16
1

hi!

there is a bug, the window is resizeable and goes black if resized

you have to replace resize = false by resizeable = false in the code ^w^

P#147452 2024-04-27 18:34
1

Thanks for catching that, I'll get an update out promptly!

P#147455 2024-04-27 20:12
1

(it seems that the bug is not patched in the #colours-2 cart)

P#147460 2024-04-27 21:56
1

Don't know how that fix didn't save cause I definitely put it in, aw well. the new version; 1.3 (#colours-3), now works as intended. Thanks again.

P#147473 2024-04-28 07:59

SVEDEN11,

I ran into that same problem. The reason is because the filename of the app is no longer Colours.p64

I downloaded it on April 30, 2024, and I had to change the create_process name to...

"/appdata/tooltray/colours-3.p64.png"

Assuming you didn't rename the file, and putt it in the appdata/tooltray folder, this should work for you.

P#147659 2024-04-30 18:34

You need to save it however and wherever you want, and then specify that file name in the widget snippet, whatever it may be.

So when you do load #colours or with a specific version with #colours-3 or whatever, you then want to save it like save /appdata/tooltray/Colours.p64

Doing load just puts the cart into your RAM and does not save it to your system, without you telling it to do so.

However, you seemed to have saved it as colours-3.p64.png which I imagine you've done this by downloading the cart image on your host OS and putting it into your mounted drive for Picotron?

I would recommend downloading it the way I've put above within Picotron itself. Means you get the latest cartridge when you do the non-numbered version of the command as well.

P#147718 2024-05-01 14:42

[Please log in to post a comment]