;; Color Cycle effect - animated hue rotation
(require-primitives "color_ops")

(define-effect color_cycle
  :params (
    (speed :type int :default 1 :range [0 10])
  )
  (let ((shift (* t speed 360)))
    (map-pixels frame
      (lambda (x y c)
        (let* ((hsv (rgb->hsv c))
               (new-h (mod (+ (first hsv) shift) 360)))
          (hsv->rgb (list new-h (nth hsv 1) (nth hsv 2))))))))
