|
|
@ -30,21 +30,26 @@ |
|
|
|
(String.Concat("[ERROR] The colour specifed is invalid.\n", |
|
|
|
(String.Concat("[ERROR] The colour specifed is invalid.\n", |
|
|
|
"Please use the 'list-colours' command to see what you can use.")) |
|
|
|
"Please use the 'list-colours' command to see what you can use.")) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let getDesktopPath = |
|
|
|
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) |
|
|
|
|
|
|
|
|
|
|
|
let parsePath (path: string) = |
|
|
|
let parsePath (path: string) = |
|
|
|
match path with |
|
|
|
match path with |
|
|
|
| path when ((path.ToLower()).Equals "desktop") -> |
|
|
|
| path when ((path.ToLower()).Equals "desktop") -> getDesktopPath |
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) |
|
|
|
| path when ((path.ToLower()).Equals "d") -> getDesktopPath |
|
|
|
| path when ((path.ToLower()).Equals "d") -> |
|
|
|
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) |
|
|
|
|
|
|
|
| _ -> path |
|
|
|
| _ -> path |
|
|
|
|
|
|
|
|
|
|
|
let buildBasicSpec iWidth iHeight mainColour path = |
|
|
|
let buildDefaultSpec iWidth iHeight = |
|
|
|
|
|
|
|
let oSpec = |
|
|
|
|
|
|
|
{ colour = Brushes.Black |
|
|
|
|
|
|
|
overlayType = Full } |
|
|
|
let spec = |
|
|
|
let spec = |
|
|
|
{ width = iWidth; |
|
|
|
{ width = iWidth |
|
|
|
height = iHeight; |
|
|
|
height = iHeight |
|
|
|
colour = parseColour mainColour |
|
|
|
colour = Brushes.AntiqueWhite |
|
|
|
filePath = parsePath path |
|
|
|
filePath = getDesktopPath |
|
|
|
overlay = None } |
|
|
|
overlay = Some oSpec |
|
|
|
|
|
|
|
} |
|
|
|
spec |
|
|
|
spec |
|
|
|
|
|
|
|
|
|
|
|
let parseOverlay (oType: string) = |
|
|
|
let parseOverlay (oType: string) = |
|
|
@ -55,17 +60,26 @@ |
|
|
|
| "f" -> Full |
|
|
|
| "f" -> Full |
|
|
|
| _ -> invalidArg "Overlay Type" "The overlay type must be either 'border' or 'full'." |
|
|
|
| _ -> invalidArg "Overlay Type" "The overlay type must be either 'border' or 'full'." |
|
|
|
|
|
|
|
|
|
|
|
// Need to think about building the two spec's seperately and bring them together in one place. |
|
|
|
let buildOverlaySpec oColour (oType: string) = |
|
|
|
// I'm repeating myself a little too much here. |
|
|
|
|
|
|
|
// Also, need to adjust pen width to match the image size (in library proj.). |
|
|
|
|
|
|
|
let buildOverlaySpec iWidth iHeight mainColour oColour oType path = |
|
|
|
|
|
|
|
let oSpec = |
|
|
|
let oSpec = |
|
|
|
{ colour = parseColour oColour; |
|
|
|
{ colour = parseColour oColour; |
|
|
|
overlayType = parseOverlay oType } |
|
|
|
overlayType = parseOverlay oType } |
|
|
|
|
|
|
|
oSpec |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let buildMainSpec iWidth iHeight mainColour path oSpec = |
|
|
|
let spec = |
|
|
|
let spec = |
|
|
|
{width = iWidth; |
|
|
|
{ width = iWidth; |
|
|
|
height = iHeight; |
|
|
|
height = iHeight; |
|
|
|
colour = parseColour mainColour; |
|
|
|
colour = parseColour mainColour |
|
|
|
filePath = parsePath path; |
|
|
|
filePath = parsePath path |
|
|
|
overlay = Some oSpec } |
|
|
|
overlay = oSpec } |
|
|
|
spec |
|
|
|
spec |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let buildSpec iWidth iHeight mainColour oColour (oType: string) path = |
|
|
|
|
|
|
|
let spec = |
|
|
|
|
|
|
|
match oType.ToLower() with |
|
|
|
|
|
|
|
| "none" | "n" -> buildMainSpec iWidth iHeight mainColour path option.None |
|
|
|
|
|
|
|
| _ -> |
|
|
|
|
|
|
|
let oSpec = buildOverlaySpec oColour oType |
|
|
|
|
|
|
|
buildMainSpec iWidth iHeight mainColour path (Some oSpec) |
|
|
|
|
|
|
|
spec |
|
|
|