Trying to control individual LEDs of a single RGB LED

I'm trying to learn ESPhome and using an ESP32 board to control a single/individual RGB LED, not an LED strip. I want to be able to use a script to turn on the LED to all white by gradually raising the brightness from off to full brightness over about a three second period. Then, I want to dim it to off and have it raise the brightness again only this time with the color red.

I've started out by just trying to program the board to create a device in HA, which I have done with the following code:

sphome:
  name: riser-rgb-control
  friendly_name: Riser RGB Control
  compile_process_limit: 1

esp32:
  board: esp32dev
  framework:
    type: esp-idf

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "*****"

ota:
  - platform: esphome
    password: "*****************"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Riser-Rgb-Control"
    password: "************"

captive_portal:

light:
  - platform: rgb
    name: "My Riser LEDs"
    red: output_red
    green: output_green
    blue: output_blue


output:
  - platform: ledc
    pin: GPIO23
    id: output_red
    inverted: false
  - platform: ledc
    pin: GPIO22
    id: output_green
    inverted: false
  - platform: ledc
    pin: GPIO21
    id: output_blue
    inverted: false

This has created a device, but it only has one control, which I can use to turn the whole unit (all three LEDs) on or off. What do I need to do to control each of the legs individually?

You use the light.turn_on action, but with the desired combination of colors/channel values as shown in the action's example:

User interface presents one control, but on your script you can control the channels individually.
If you need also separate control on UI, you need 3 monochromatic lights, one for each channel.

This led me to the information I needed and used it to create two scripts. Here's the one for transitioning from any color (or off) to red over a period of 10 seconds:

action: light.turn_on
metadata: {}
target:
  entity_id: light.riser_rgb_control_my_riser_leds
data:
  transition: 10
  rgb_color:
    - 250
    - 0
    - 0
  brightness_pct: 100

In the future it would improve the odds you get a more specific answer if you provide details like the fact that you were looking for help with an HA script, not an ESPHome script.