Log In  


Cart #colours-10 | 2024-05-10 | Embed ▽ | License: CC4-BY-NC-SA
21

Colour Reference

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

Think I'm mostly done with this app now as of v3.0. I have one more idea but I'll probably take a break before doing it and try and move onto something else in the meantime. I have what I want now to help with my development and learned a lot on the way too, hope this app can be useful to you too.

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:

  • Chromatic - Change the ordering of the colours to
    be more reminiscent of the editors

  • 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", "Chromatic" "PaddingSize=4"}
})

The order of the args does not matter

Changelog:

v3.0

  • Added Chromatic ordering that changes the orders of the colours to be more reminiscent of what you see in the editors. This can be changed in the windowed version in the hamburger menu with the Change Ordering option, and can be done for the widget with the Chromatic arg.
  • removed un-needed files from the cart (Actually this time -.-)

v2.3

  • Implemented parsing of args for customising the look of the app when installed as a widget.

v2.2

  • Reimplemented the original default (larger) font version. Changeable via the Change 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 Change Dark Text Style 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)

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.
21


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.


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


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


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?


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^


1

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


1

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


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.


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.


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.



[Please log in to post a comment]