Log In  
Follow
MrScottyTay
[ :: Read More :: ]

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

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)