How about creating a program that could come up with dark modes at random? :O
This comes up with 20 of them at a time. I have purposely supplied this program dumping the scheme lines into the terminal and not creating any text file. You could comment out the lines which create an output file and change the destination filename to your liking. THIS CANNOT BE "internal/config.ini" or your whole QB64 IDE configuration will be trashed!
Many of the configurations made by this program aren't very good, too extreme sometimes. But I tried to follow along one that was provided.
The lines this silly program creates have to be inserted in a specific place of the "config.ini". In particular:
Code: (Select All)
[IDE COLOR SCHEMES]
Instructions1="Create custom color schemes in the IDE (Options->IDE Colors)."
Instructions2="Custom color schemes will be stored in this section."
<<<insert the scheme strings here>>>
[IDE WINDOW 1]
IDE_Width=120
IDE_Height=40
Oh yeah, almost forgot to say: change the names of good schemes that you find, which are more suitable than "Random1", "Random2" etc. Change the name that is on RHS of the equals sign only, out of a scheme entry.
It is up to you to plug these definitions into your "config.ini". I will not be held responsible if it ruins what you have carefully sculpted. LOL.
Code: (Select All)
'by mnrvovrfc 30-June-2023
$CONSOLE:ONLY
option _explicit
dim sf(1 to 20) as string
dim as integer i, rr, gg, bb, c, w
dim afile$, a$, e$, fe as long
'this was posted originally by a740g on QB64PE forums,
' so this program's randomization is "guided" by it LOL
' I added the semicolons to make sure the list of numbers
' were trios of RGB
'Scheme1$=VSCode|
'226;226;226
'115;222;227;
'255;043;138;
'255;178;034;
'185;237;049;
'157;118;137;
'043;045;037;
'010;000;020;
'088;088;088;
'170;170;170;
randomize timer
$IF WIN THEN
afile$ = environ$("USERPROFILE") + "\Documents\qb64ide.txt"
$ELSE
afile$ = environ$("HOME") + "/Documents/qb64ide.txt"
$END IF
for w = 1 to 20
a$ = "Scheme" + _trim$(str$(w)) + "$=Random" + _trim$(str$(w)) + "|"
e$ = a$ + space$(90)
c = len(a$) + 1
for i = 1 to 10
select case i
case 3, 4, 5
rr = Rand(16, 96)
gg = Rand(96, 160)
bb = Rand(160, 255)
if Random1(2) = 1 then swap rr, gg
if Random1(2) = 1 then swap gg, bb
if Random1(2) = 1 then swap rr, bb
case 7, 8, 9
rr = Random1(96)
gg = Rand(16, 64)
bb = Rand(32, 96)
if Random1(2) = 1 then swap gg, bb
if Random1(2) = 1 then swap rr, gg
if Random1(2) = 1 then swap rr, bb
case else
rr = Rand(64, 255)
gg = Rand(64, 255)
bb = Rand(64, 255)
end select
mid$(e$, c, 3) = Zeroes$(rr, 3)
c = c + 3
mid$(e$, c, 3) = Zeroes$(gg, 3)
c = c + 3
mid$(e$, c, 3) = Zeroes$(bb, 3)
c = c + 3
next
sf(w) = e$
next
'fe = freefile
'open afile$ for output as fe
for w = 1 to 20
print sf(w)
next
'close fe
PRINT "ALL DONE!"
system
FUNCTION Rand& (fromval&, toval&)
DIM sg%, f&, t&
IF fromval& = toval& THEN
Rand& = fromval&
EXIT FUNCTION
END IF
f& = fromval&
t& = toval&
IF (f& < 0) AND (t& < 0) THEN
sg% = -1
f& = f& * -1
t& = t& * -1
ELSE
sg% = 1
END IF
IF f& > t& THEN SWAP f&, t&
Rand& = INT(RND * (t& - f& + 1) + f&) * sg%
END FUNCTION
FUNCTION Random1& (maxvaluu&)
DIM sg%
sg% = SGN(maxvaluu&)
IF sg% = 0 THEN
Random1& = 0
ELSE
IF sg% = -1 THEN maxvaluu& = maxvaluu& * -1
Random1& = INT(RND * maxvaluu& + 1) * sg%
END IF
END FUNCTION
FUNCTION Zeroes$ (num AS LONG, numdig AS INTEGER)
DIM b$, hx as long, v as long, sg as integer
IF num < 0 THEN sg = -1: num = num * -1
IF numdig < 0 THEN hx = 1: numdig = numdig * -1 ELSE hx = 0
IF hx THEN
b$ = HEX$(num)
ELSE
b$ = LTRIM$(STR$(num))
END IF
v = numdig - LEN(b$)
IF v > 0 THEN b$ = STRING$(v, 48) + b$
IF sg = -1 THEN b$ = "-" + b$
Zeroes$ = b$
END FUNCTION
EDIT: These are just four examples: