Tuesday, February 16, 2010

Colorwheel with gradients



Here is the blue yellow gradient and the script

(define img (car (gimp-image-new 512 512 0)))

(define baselayer (car(gimp-layer-new img 512 512 0 "layer 1" 100 0)))
(gimp-image-add-layer img baselayer -1)

(gimp-display-new img)

(gimp-context-set-background '(255 255 0))
(gimp-context-set-foreground '(0 0 255 ))

(gimp-edit-blend baselayer 3 0 0 100 0 0 FALSE FALSE 1 0 TRUE 0 0 512 512)

Colorwheel with gradients


I didn't figure out how to make wedges but i did it another way. This way will let me make a smooth and continuous wheel where every possible hue the computer knows is represented.

gradients
Here is the script.

(define img (car (gimp-image-new 512 512 0)))

(define baselayer (car(gimp-layer-new img 512 512 0 "layer 1" 100 0)))
(gimp-image-add-layer img baselayer -1)

(gimp-display-new img)

(define i 0)

(define numrots 765)


(gimp-context-set-background '(255 255 255))
(set! i 0)
(while (< i numrots)
(define colorlayer (car(gimp-layer-new img 3 256 0 "layer 1" 100 0)))
(gimp-image-add-layer img colorlayer -1)


(if (> i -1)
(gimp-context-set-foreground '((- 255 200) 0 0))
)

(if (> i 255)
(gimp-context-set-foreground '(0 255 0))

)

(if (> i 510)
(gimp-context-set-foreground '( 0 0 255))

)

(gimp-edit-blend colorlayer 3 0 0 100 0 0 FALSE FALSE 1 0 TRUE 256 0 256 256)

(gimp-layer-translate colorlayer 256 0)
(gimp-drawable-transform-rotate colorlayer (* 0.008211150327 i) FALSE 256 256 0 2 TRUE 3 0)

(gimp-image-merge-visible-layers img 2)


(set! i (+ i 1))
)

No comments:

Post a Comment