Here a couple of example:
view layout [ button black "Click me" ]
or
view layout [ button 0.0.0 "Click me"]
Here the result:
However there are a loot of colors memorized as a name in Rebol, here a script that help you to remember all:
Here the source:
REBOL [
Title: "REBOL Standard Colors"
Date: 31-Mar-2001
Version: 1.0.2
File: %color-names.r
Author: ["Carl Sassenrath" "Massimiliano Vessi"]
Purpose: "Displays the official built-in REBOL named colors."
Email: carl@rebol.com
]
colors: [
black blue navy orange gold tan
coal green leaf forest brown coffee
gray cyan teal aqua water sky
pewter red maroon brick crimson pink
silver magenta purple violet papaya rebolor
snow yellow olive oldrab khaki mint
white ivory linen beige base-color
reblue sienna wheat
]
sort colors
out: [
style btn button font-size 11 100x38 [
sc/color: face/color
sc/text: reform ["Click a color to show it here ^/" face/text]
show sc
]
across
]
cnt: 1
foreach color colors [
repend out ['btn color reform [color newline get color]]
if zero? cnt // 6 [append out 'return]
cnt: cnt + 1
]
append out [
sl: slider 208x38 "Multiplier" font [
color: silver align: 'center valign: 'middle shadow: none][mult-color value ]
return
sc: box 650x80 font-size 12 "Click a color to show it here" return
button 650x40 black "Click here for custom color" [
face/color: request-color/color any [face/color gray]
face/texts: reduce [reform face/color ]
show face
]
]
mult-color: func [factor /local clr n m d] [
n: 1
m: max 1 to-integer factor - .5 * 8
d: max 1 to-integer .5 - factor * 8
sl/text: reform either factor > .5 [["times" m]][["divided by" d]]
foreach color colors [
clr: either factor > .5 [(get color) * m][(get color) / d]
window/pane/:n/color: clr
window/pane/:n/texts: reduce [reform [color newline clr]]
n: n + 1
]
show window
]
window: layout out
view window
The REBOL predefined color words, that you can use everywhere (VID, DRAW, script), are:
Name | Value | Color | Name | Value | Color | |
aqua | 40.100.130 | base-color | 200.200.200 | |||
beige | 255.228.196 | black | 0.0.0 | |||
blue | 0.0.255 | brick | 178.34.34 | |||
brown | 139.69.19 | coal | 64.64.64 | |||
coffee | 76.26.0 | crimson | 220.20.60 | |||
cyan | 0.255.255 | forest | 0.48.0 | |||
gold | 255.205.40 | gray | 128.128.128 | |||
green | 0.255.0 | ivory | 255.255.240 | |||
khaki | 179.179.126 | leaf | 0.128.0 | |||
linen | 250.240.230 | magenta | 255.0.255 | |||
maroon | 128.0.0 | mint | 100.136.116 | |||
navy | 0.0.128 | oldrab | 72.72.16 | |||
olive | 128.128.0 | orange | 255.150.10 | |||
papaya | 255.80.37 | pewter | 170.170.170 | |||
pink | 255.164.200 | purple | 128.0.128 | |||
reblue | 38.58.108 | rebolor | 142.128.110 | |||
red | 255.0.0 | sienna | 160.82.45 | |||
silver | 192.192.192 | sky | 164.200.255 | |||
snow | 240.240.240 | tan | 222.184.135 | |||
teal | 0.128.128 | violet | 72.0.90 | |||
water | 80.108.142 | wheat | 245.222.129 | |||
white | 255.255.255 | yellow | 255.255.0 |
No comments:
Post a Comment