extract

extract components from path


Parameters

extract path :string :color

Attributes

directoryget path directory
basenameget path basename (filename+extension)
filenameget path filename
extensionget path extension
schemeget scheme field from URL
hostget host field from URL
portget port field from URL
userget user field from URL
passwordget password field from URL
pathget path field from URL
queryget query field from URL
anchorget anchor field from URL
redget red component from color
greenget green component from color
blueget blue component from color
alphaget alpha component from color
hslget HSL representation from color
hsvget HSV representation from color
hueget hue component from color
saturationget saturation component from color
luminosityget luminosity component from color

Returns

  • :string
  • :dictionary

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