Light RGB color to Matrix 8x8 switch

Hi everyone, I’m pretty new to home assistant, I’m trying to set up a frontend interface to control an 8x8 Led matrix.
The operation is ok but I’d like to improve the user interface.
In principle, I’d like to use the color picker of the light element to select a color; pressing the central button turns on all the pixels and the background color of the switch pixel entities equal to the selected color; pressing the pixel turns on or off the corresponding pixel with the background color equal to the last selected color.
Ideally, if you press the central button and set the switch to ON, you’ll only be able to change the color of the button icon to the selected color.
Below is a test element with two pixels that I could then replicate in 8x8.

type: vertical-stack
cards:
  - type: custom:button-card
    color_type: label-card
    color: rgb(44, 109, 214)
    name: RGB Table
  - type: entities
    entities:
      - entity: light.table
        secondary_info: none
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        entity: switch.commande_table
        color_type: card
        icon: mdi:table-furniture
        show_name: false
        styles:
          card:
            - height: 80px
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        entity: switch.table_pixel_0
        color_type: card
        icon: none
        show_name: false
      - type: custom:button-card
        entity: switch.table_pixel_1
        color_type: card
        icon: none
        show_name: false

Thanks in advance for your answers and help.