[Feature] Ability to set random for colour codes #791

Open
opened 2025-06-17 14:42:21 +02:00 by tripplehelix · 3 comments

Pre-requisites

  • I have looked for any other duplicate issues
  • I have confirmed the requested feature doesn't exist in the latest version in development

Wanted behavior

From following the PR for a Game of Life background, I thought it might be cool if there was a random function we could use instead of a colour code. Effectively allowing any part of the UI or background to pull a random colour from a list.

I'm guessing with the way things work, these colour codes would need to be generated and selected once Ly has started ready for the next reboot or restart of Ly.

The user could list colours under a Random colours section in the config, then each UI element would randomly pull a colour from this list.

I don't think there would be an issue if it were to pull duplicate colours as the user can customise everything and specify important UI elements to make them readable, or just go nuts.

### Pre-requisites - [x] I have looked for any other duplicate issues - [x] I have confirmed the requested feature doesn't exist in the latest version in development ### Wanted behavior From following the PR for a Game of Life background, I thought it might be cool if there was a `random` function we could use instead of a colour code. Effectively allowing any part of the UI or background to pull a random colour from a list. I'm guessing with the way things work, these colour codes would need to be generated and selected once Ly has started ready for the next reboot or restart of Ly. The user could list colours under a `Random colours` section in the config, then each UI element would randomly pull a colour from this list. I don't think there would be an issue if it were to pull duplicate colours as the user can customise everything and specify important UI elements to make them readable, or just go nuts.
Owner

@tripplehelix Sorry for the late response, but I'm not sure this is a good idea.

  • First, this raises a few questions implementation-wise. Should we make this list configurable? Should the list contain all 16 default colors (like pre-v1.1.0)? If not, which colors does it contain? Also, a color is a 32-bit integer, but "random" is a string. There's no trivial way to specify this as one single type in Zig (I could work around it, but it'd be pretty ugly, though I guess that's an implementation detail).
  • Now, let's say we make it configurable. This would be non-trivial to do in the current configuration format, because the INI file format doesn't specify how to make lists, and as such nothing like that is implemented in the parser Ly uses. We could create a separate file with all colors perhaps, or even change format completely, but that sounds like a lot just for one list.
  • Finally, while I'm all in for customization, I'm not sure this would even look good in the majority of cases. Sure, you could use it for, say, the foreground color (which applies to all text for example), or the game of life animation, but in other cases like the color mix & DOOM animations, it could end up looking quite weird. Though, to be fair, I'm no one to judge other people's tastes 😄
@tripplehelix Sorry for the late response, but I'm not sure this is a good idea. - First, this raises a few questions implementation-wise. Should we make this list configurable? Should the list contain all 16 default colors (like pre-v1.1.0)? If not, which colors does it contain? Also, a color is a 32-bit integer, but "random" is a string. There's no trivial way to specify this as one single type in Zig (I could work around it, but it'd be pretty ugly, though I guess that's an implementation detail). - Now, let's say we make it configurable. This would be non-trivial to do in the current configuration format, because the INI file format doesn't specify how to make lists, and as such nothing like that is implemented in the parser Ly uses. We could create a separate file with all colors perhaps, or even change format completely, but that sounds like a lot just for one list. - Finally, while I'm all in for customization, I'm not sure this would even look good in the majority of cases. Sure, you could use it for, say, the foreground color (which applies to all text for example), or the game of life animation, but in other cases like the color mix & DOOM animations, it could end up looking quite weird. Though, to be fair, I'm no one to judge other people's tastes 😄
Author
  1. Sounds like you'd have to have a list of colours and randomly pick from this list, which could then be customisable in the settings.
  2. Could we just associate each colour in the ini file to a number, then have the numbers 1-16 picked from randomly in the code? I don't think creating a new file for just colours would be a good idea at all.
  3. Yes, which is why the user would need to specify which elements were randomised, maybe just background colours, maybe just the border box. Probably need to limit it, if we did limit it I'd say limit to just background effects and colours. Which is where my original idea stemmed from. I don't think weird is a bad thing, you should see some of my horrendous colours schemes.

So to summarise; list of colours in the config which are configurable, are linked to numbers, which I'm sure zig can randomise. Only applied to background animations and background colour?

# Do you want the background colours to be random?
random = true

# Randomised background colours
1 = 00ffffff
2 = 00000000
3 = 00ff00ff
...
1. Sounds like you'd have to have a list of colours and randomly pick from this list, which could then be customisable in the settings. 2. Could we just associate each colour in the ini file to a number, then have the numbers 1-16 picked from randomly in the code? I don't think creating a new file for just colours would be a good idea at all. 3. Yes, which is why the user would need to specify which elements were randomised, maybe just background colours, maybe just the border box. Probably need to limit it, if we did limit it I'd say limit to just background effects and colours. Which is where my original idea stemmed from. I don't think weird is a bad thing, you should see some of my horrendous colours schemes. So to summarise; list of colours in the config which are configurable, are linked to numbers, which I'm sure zig can randomise. Only applied to background animations and background colour? ```` # Do you want the background colours to be random? random = true # Randomised background colours 1 = 00ffffff 2 = 00000000 3 = 00ff00ff ...
Owner

Honestly, I think implementing this feature with the current configuration file format is not a good idea. But with something like a shell script, this'd be much easier to implement (technically speaking, Ly wouldn't have to implement the feature then, since the randomisation could be done inside the shell script itself).

Honestly, I think implementing this feature with the current configuration file format is not a good idea. But with something like a shell script, this'd be much easier to implement (technically speaking, Ly wouldn't have to implement the feature then, since the randomisation could be done inside the shell script itself).
AnErrupTion added this to the Future milestone 2025-09-27 10:53:08 +02:00
AnErrupTion modified the milestone from Future to 1.4.0 2025-12-01 13:48:31 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
fairyglade/ly#791
No description provided.