extract components from path
Parameters
extract path :string :color
Attributes
directory | | get path directory |
basename | | get path basename (filename+extension) |
filename | | get path filename |
extension | | get path extension |
scheme | | get scheme field from URL |
host | | get host field from URL |
port | | get port field from URL |
user | | get user field from URL |
password | | get password field from URL |
path | | get path field from URL |
query | | get query field from URL |
anchor | | get anchor field from URL |
red | | get red component from color |
green | | get green component from color |
blue | | get blue component from color |
alpha | | get alpha component from color |
hsl | | get HSL representation from color |
hsv | | get HSV representation from color |
hue | | get hue component from color |
saturation | | get saturation component from color |
luminosity | | get luminosity component from color |
Returns
Examples
copy
path: "/this/is/some/path.txt"
print extract.directory path ; /this/is/some
print extract.basename path ; path.txt
print extract.filename path ; path
print extract.extension path ; .txt
print extract path
; [directory:/this/is/some basename:path.txt filename:path extension:.txt]
copy
url: "http://subdomain.website.com:8080/path/to/file.php?q=something#there"
print extract.scheme url ; http
print extract.host url ; subdomain.website.com
print extract.port url ; 8080
print extract.user url ;
print extract.password url ;
print extract.path url ; /path/to/file.php
print extract.query url ; q=something
print extract.anchor url ; there
print extract url
; [scheme:http host:subdomain.website.com port:8080 user: password: path:/path/to/file.php query:q=something anchor:there]
copy
extract #magenta
; => [red:255 green:0 blue:255]
extract.red #FF126D
; => 255
extract.hsl #magenta
; => [hue:300 saturation:1.0 luminosity:0.5]
extract.hue #magenta
; => 300
Related