Skip to content

Added !NEW! SimpleColor action block#928

Merged
SukuWc merged 35 commits intostablefrom
feat/ColorPicker
Mar 18, 2025
Merged

Added !NEW! SimpleColor action block#928
SukuWc merged 35 commits intostablefrom
feat/ColorPicker

Conversation

@elsoazemelet
Copy link
Contributor

@elsoazemelet elsoazemelet commented Jan 29, 2025

The expected behaviour and design proposal is described in the ticket that this PR closes. See below.

Closes #912

@github-actions
Copy link

github-actions bot commented Jan 29, 2025

Visit the preview URL for this PR (updated for commit b0314a5):

https://grid-editor-web--pr928-feat-colorpicker-fsug8m36.web.app

(expires Tue, 25 Mar 2025 21:14:04 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2b65ba6ef19c55d367eaffd04e46bcde25305d6f

@danim1130
Copy link
Contributor

Can we move the ColorPicker components to the uikit library?

@elsoazemelet elsoazemelet changed the title UI proposal Added !NEW! EasyColor action block Feb 12, 2025
@Greg-Orca Greg-Orca self-assigned this Feb 13, 2025
@Greg-Orca
Copy link
Contributor

Test Failed:

Issues:

  • Module LEDs do not receive the color.
  • Not working: Each active keyframe can be selected on the preview display, but R, G, B, and alpha values are not loaded for the given keyframe.
  • Cannot write RGB and alpha values in the text box; displays 'NaN'.

env: MacOS

Screen.Recording.2025-02-13.at.11.30.16.mov

@narayb
Copy link
Collaborator

narayb commented Feb 13, 2025

We'll issue an updated design for the colorbar as it looks too much like a slider and causes the user expectation that it's clickable and slide-able. That's on the design, we'll fix it.

Aside from this the feature looks as specified. Nice!

However I can only echo the sentiments of @Greg-Orca above:

  • slider does not update position or values when switching between color states min, mid or max
  • layer 0 does not exist, therefore it should not be a default layer (layers are 1 or 2)
  • typing into the value fields does not produce a change, fields become NaN
  • any kind of configuration created doesn't run on the nightly firmware currently, possibly awaiting a new FW patch to implement the functionality itself (this could be the cause of the above problems as well?)
  • the parameters should match already existing, similar blocks in design (LED Number input field followed by Layer input field)

kép

  • resizing the panel causes the colorwheel to grow unnecessarily large, the colorwheel size should probably stay static

color1

  • 'Easy Color' is not the name I would give to the block itself, something akin to Simple Color would suit it better
  • the randomization of a new added color wasn't part of the specification, and the way Editor hadles it causes it to change the configuration constantly

color2

Also the sequence of events when adding new colors is wrong. Now what it does is:
1, Has a color at the max, then you add a second color.
2, The color previously at the max moves to the min position.

What it should be doing instead:
1, Has a color at the max, then you add a second color.
2, The color previously at the max should still stay at the max position and the second color should move into the min position.

@elsoazemelet elsoazemelet changed the title Added !NEW! EasyColor action block Added !NEW! SimpleColor action block Feb 17, 2025
@elsoazemelet
Copy link
Contributor Author

elsoazemelet commented Feb 17, 2025

  • Color picker Square Y axis and Circle radius should set brightness 50 to 100 and render picker accordingly
  • Selection order when adding new should follow visual adding (max, min, middle)
  • Selection should be more visible (not pretty)
  • Fix square pickers out of bound selection
  • Make VM more lightweight

@Greg-Orca
Copy link
Contributor

Greg-Orca commented Feb 19, 2025

Test Failed

  • Variables are not working in the RGBA input fields
Screenshot 2025-02-19 at 13 50 24
  • HSL sliders jumping while adjusting
  • Still cant write any parameters to the RGBA input fields

@Greg-Orca
Copy link
Contributor

Greg-Orca commented Feb 20, 2025

Test Failed

  • Variables not working in RGBA, Classic, and HSL input fields
  • The circle is out of the color picker when using a low number or 0
Screenshot 2025-02-20 at 14 10 51 Screenshot 2025-02-20 at 14 12 11
  • circle is not jumps to the corresponding RGBA and Classic value
    Screenshot 2025-02-20 at 14 25 46

  • HSL still jumps while adjusting parameters

Screenshot 2025-02-20 at 14 1

@narayb
Copy link
Collaborator

narayb commented Feb 21, 2025

Color picker design change

The current design fails to serve the user on the following points:

  • it has no way to display dark colours on the colour picker
  • the user is not able to pick dark colours on the colour picker
  • the intensity does not fulfill the part of "darkening" either

The Solution is to use a design that solves these issues.
simplecolorpicker
Taken from https://rgbcolorpicker.com/

The truth is, for this the block has to work like this:

1, It has fields for color code entry in multiple formats (RGB, HSV, HSL, HEX etc), but has only one color picker to display the result.
2, Color code entry happens and then gets transformed to a format that can be properly displayed on the - normally - HSL color picker above.

@Greg-Orca
Copy link
Contributor

Test Failed

  • Color change not synchronized while dragging and dropping the picker; only when releasing the picker. (The previous version had this functionality.)
Screenshot 2025-02-21 at 12 59 16
  • at RGB 0, 0, 0 picker out of the circle
Screenshot 2025-02-21 at 12 59 16
  • The picker is not perfectly aligned with the color palette. On the right side, I can pull it out, but on the left side, I cannot.
Screenshot 2025-02-21 at 12 59 16
  • Opening and closing the Action block fails to maintain the chosen color picker state.
Screenshot 2025-02-21 at 12 59 16

@elsoazemelet elsoazemelet moved this from In Progress to Ready for QA in Editor Roadmap Mar 12, 2025
@Greg-Orca Greg-Orca moved this from Ready for QA to QA in progress in Editor Roadmap Mar 13, 2025
@Greg-Orca
Copy link
Contributor

Test Result

Passed:

  • smooth transitions
  • live update
  • picker is always in correct positions

Failed:

  • Intensity not updates now if I switch in color "stage"
    ezgif-40764767478105

  • Intensity can't be adjusted only to the middle stage; it influences the right endpoint
    ezgif-449ca62b419562

@Greg-Orca Greg-Orca moved this from QA in progress to In Progress in Editor Roadmap Mar 13, 2025
@elsoazemelet elsoazemelet moved this from In Progress to Ready for QA in Editor Roadmap Mar 13, 2025
@Greg-Orca Greg-Orca moved this from Ready for QA to In Progress in Editor Roadmap Mar 13, 2025
@elsoazemelet elsoazemelet moved this from In Progress to Ready for QA in Editor Roadmap Mar 14, 2025
@SukuWc
Copy link
Member

SukuWc commented Mar 15, 2025

Functionality can now be tested on real modules!

  1. Get a real module
  2. Update to nightly firmware: https://github.com/intechstudio/grid-fw/raw/preview/Preview/Firmware/grid_esp32_nightly.uf2
  3. Clear all configuration
  4. Select the system element and add the following code to its setup event:
for i = 0, #element do
    element[i].led_color = function(self, l, c)
        print("Easy color triggered", l, #c)
        local up = table.unpack
        local i, x, y, z = self:element_index(), c[1], c[2], c[#c]
        if #c == 1 then
            x = {0, 0, 0, 0}
            y = {z[1] // 2, z[2] // 2, z[3] // 2, z[4] / 2}
        elseif #c == 2 then
            y = {(x[1] + z[1]) // 2, (x[2] + z[2]) // 2, (x[3] + z[3]) // 2, (x[4] + z[4]) / 2}
        elseif #c == 3 then
        end
        led_color_min(i, l, up(x))
        led_color_mid(i, l, up(y))
        led_color_max(i, l, up(z))
    end
end
print("Easy color installed")
  1. Now you can use the Easy Color action on the control elements.
  2. Note that led intensity should be set to -1, this causes the firmware to calculate the correct color mix between minimum and maximum value.

Screenshot_2025-03-16_00-32-53

@SukuWc
Copy link
Member

SukuWc commented Mar 15, 2025

Bug found:
Adding or removing keyframes send Syncs with grid before sending new config out (reactivity order is reversed, dispatch("sync") runs befor the reactive $: statment on the data store)

  function handleAddLayer() {
    const last = get(data).previewColors.at(-1);
    data.addLayer(last);

    dispatch("sync");
  }

  function handleRemoveLayer() {
    const selected = get(data).selectedIndex;
    data.removeLayer(selected);

    dispatch("sync");
  }

@SukuWc SukuWc moved this from Ready for QA to In Progress in Editor Roadmap Mar 17, 2025
@elsoazemelet elsoazemelet moved this from In Progress to Ready for QA in Editor Roadmap Mar 18, 2025
@Greg-Orca Greg-Orca moved this from Ready for QA to In Progress in Editor Roadmap Mar 18, 2025
@elsoazemelet elsoazemelet moved this from In Progress to Ready for QA in Editor Roadmap Mar 18, 2025
@Greg-Orca
Copy link
Contributor

Test Failed

The editor freezes when I use a function (e.g., self:encoder_value()) in an input field and then close and reopen the Simple Color block (or copy and paste)

Screenshot_2025-03-18_at_15 38 58

@Greg-Orca Greg-Orca moved this from Ready for QA to In Progress in Editor Roadmap Mar 18, 2025
@SukuWc
Copy link
Member

SukuWc commented Mar 18, 2025

Parsing bug fixed for red, green, blue and alpha input fields!
Num and layer fields are special due to underlying parsing strategy, these do not produce runtime error but parsing can be incorrect!

Separate issues created to track upcoming work:
#1040
#1041

@SukuWc SukuWc merged commit 0a36356 into stable Mar 18, 2025
17 of 18 checks passed
@elsoazemelet elsoazemelet moved this from In Progress to Done in Editor Roadmap Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Implement new color action block based on reference design

5 participants