Skip to content

Commit

Permalink
feat: add initial values to Color struct
Browse files Browse the repository at this point in the history
Adds convenience for mac users where the default color-picker values
(black(r: 0, g: 0, b: 0) and transparent color(a: 0)) would in both
cases not allow to immediately choose a color without first changing those values.
  • Loading branch information
ttytm committed Jun 3, 2024
1 parent 5854b8b commit 8ef73e7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
module dialog

import os
import rand

@[params]
pub struct MessageOptions {
Expand Down Expand Up @@ -45,7 +46,12 @@ pub:
@[params]
pub struct ColorPickerOptions {
pub:
color Color // is the initial color.
color Color = Color{ // is the initial color.
r: rand.u8()
g: rand.u8()
b: rand.u8()
a: 255
}
opacity bool = true // can be set to `false` to disable the opacity slider on Linux.
}

Expand Down

0 comments on commit 8ef73e7

Please sign in to comment.