Welcome to my Code Snippets

MyCodeSnippets.Space

Flip image in Red

ReAdABLE Source (What is the ReAdABLE Human Format?)

http://mycodesnippets.space/red/image-flip.red

Demo

Type in red-lang console:

do read http://mycodesnippets.space/redlang/src/image-flip.red

https://i.imgur.com/vPw7RuI.png

Code Snippet

https://i.imgur.com/35mJBVj.png


Red [
    Title: "image-flip.red"
    Needs: 'View
]

img1: load http://mycodesnippets.space/images/snapchat_128.png
img2: load http://mycodesnippets.space/images/youtube_128.png

view layout compose [
    image "Flip" img1 on-over [
        img: face/image
        either img = img1 [
            face/image: img2
        ][
            face/image: img1
        ]
    ] 
]