summaryrefslogtreecommitdiff
path: root/ricky/imgradient
diff options
context:
space:
mode:
Diffstat (limited to 'ricky/imgradient')
-rw-r--r--ricky/imgradient/__init__.py1
-rw-r--r--ricky/imgradient/imgradient.py12
-rw-r--r--ricky/imgradient/options.py83
-rw-r--r--ricky/imgradient/params.py45
4 files changed, 141 insertions, 0 deletions
diff --git a/ricky/imgradient/__init__.py b/ricky/imgradient/__init__.py
new file mode 100644
index 0000000..72efca1
--- /dev/null
+++ b/ricky/imgradient/__init__.py
@@ -0,0 +1 @@
+from ricky.imgradient.imgradient import ImGradient
diff --git a/ricky/imgradient/imgradient.py b/ricky/imgradient/imgradient.py
new file mode 100644
index 0000000..c7be83d
--- /dev/null
+++ b/ricky/imgradient/imgradient.py
@@ -0,0 +1,12 @@
+from ricky.api import Api
+from ricky.imgradient.params import ImGradientParams
+from ricky.config import IMGRADIENT_URL
+
+class ImGradient(Api):
+ def __init__(self):
+ self.url = IMGRADIENT_URL
+ def params_init(self):
+ new_params = ImGradientParams()
+ #new_params = self.get_from_server()
+ new_params.api = self
+ return new_params
diff --git a/ricky/imgradient/options.py b/ricky/imgradient/options.py
new file mode 100644
index 0000000..29091ce
--- /dev/null
+++ b/ricky/imgradient/options.py
@@ -0,0 +1,83 @@
+from ricky.param.options import Options
+width_options = Options.from_dict(
+ { "value" : 400, "weight" : 1 },
+ { "value" : 600, "weight" : 1 },
+)
+height_options = Options.from_dict(
+ { "value" : 400, "weight" : 1 },
+ { "value" : 600, "weight" : 1 },
+)
+color1_options = Options.from_dict(
+ { "value" : "black", "weight" : 1 },
+ { "value" : "white", "weight" : 2 },
+)
+color2_options = Options.from_dict(
+ { "value" : "black", "weight" : 2 },
+ { "value" : "white", "weight" : 1 },
+)
+stripes_options = Options.from_dict(
+ {"value":"true", "weight": 1},
+ {"value":"false", "weight": 1},
+)
+stripenumber_options = Options.from_dict(
+ {"value":1, "weight": 50},
+ {"value":2, "weight": 50},
+)
+# contrast_options = \
+stripeintensity_options = \
+ brightness_options = \
+ saturation_options = \
+ hue_options = \
+ Options.from_dict(
+ {"value": "", "weight": 300},
+)
+halftone_options = Options.from_dict(
+ { "value" : "checkeredfade", "weight": 1 },
+ { "value" : "etchedtransition", "weight": 1 },
+ { "value" : "bendaydots", "weight": 1 },
+ { "value" : "smallerdots1", "weight": 1 },
+ { "value" : "smallerdots2", "weight": 1 },
+ { "value" : "flatstripes", "weight": 1 },
+)
+bevel_options = Options.from_dict(
+ { "value" : "", "weight" : 4 },
+ { "value" : "flatout", "weight" : 1 },
+ { "value" : "flatinner", "weight" : 1 },
+ { "value" : "evenlyframed", "weight" : 1 },
+ { "value" : "biginner", "weight" : 1 },
+ { "value" : "bigouter", "weight" : 1 },
+ { "value" : "dramaticflatout", "weight" : 1 },
+ { "value" : "dramaticflatinner", "weight" : 1 },
+)
+
+blurriness_options = \
+ percentbeveled_options = Options.from_dict(
+ { "value" : "", "weight": 4 },
+)
+rotate_options = \
+ tilt_options = Options.from_dict(
+ {"value":"", "weight": 9},
+ {"value":90, "weight": 2},
+ {"value":180, "weight": 2},
+ {"value":270, "weight": 2},
+)
+flop_options = flip_options = Options.from_dict(
+ {"value":"", "weight": 1},
+ {"value":"true", "weight": 1},
+)
+
+filetype_options = Options.from_dict(
+ {"value":"png", "weight": 5},
+ {"value":"jpg", "weight": 2},
+ {"value":"gif", "weight": 2},
+)
+gradienttype_options = Options.from_dict(
+ { "value" : "canvas", "weight" : 1 },
+ { "value" : "gradient", "weight" : 3 },
+ { "value" : "radial", "weight" : 1 },
+ { "value" : "colorspace", "weight" : 1 },
+ { "value" : "plasmawash", "weight" : 1 },
+ { "value" : "gradientwash", "weight" : 1 },
+ { "value" : "mirrored", "weight" : 1 },
+ { "value" : "noise", "weight" : 1 },
+)
diff --git a/ricky/imgradient/params.py b/ricky/imgradient/params.py
new file mode 100644
index 0000000..88b7d46
--- /dev/null
+++ b/ricky/imgradient/params.py
@@ -0,0 +1,45 @@
+import re, random
+from ricky.params import Params
+from ricky.param import Param
+from ricky.param.option import Option
+from ricky.param.options import Options
+from ricky.param.username import Username
+from ricky.param.imageurl import ImageUrl
+from ricky.param.multiselect import MultiSelect
+from ricky.param.numberrange import NumberRange
+from ricky.param.color import Color
+
+from ricky.imgradient.options import *
+
+
+
+class ImGradientParams(Params):
+ def __init__(self):
+ self.params = [
+ Username(name="username", required=0),
+ NumberRange(name="width", required=1, options=width_options, min=100, max=800),
+ NumberRange(name="height", required=1, options=height_options, min=100, max=800),
+ Color(name="color1", required=1, options=color1_options),
+ Color(name="color2", required=1, options=color2_options),
+ MultiSelect(name="filetype", required=0, options=filetype_options),
+ MultiSelect(name="gradienttype", required=1, options=gradienttype_options),
+ MultiSelect(name="halftone", required=0, options=halftone_options),
+ MultiSelect(name="bevel", required=0, options=bevel_options),
+
+ NumberRange(name="stripenumber", required=0, options=stripenumber_options, min=0, max=400),
+ NumberRange(name="stripeintensity", required=0, options=stripeintensity_options, min=0, max=5000),
+
+ NumberRange(name="blurriness", required=0, options=blurriness_options, min=0, max=200),
+# NumberRange(name="contrast", required=0, options=contrast_options, min=0, max=200),
+ NumberRange(name="brightness", required=0, options=brightness_options, min=0, max=200),
+ NumberRange(name="saturation", required=0, options=saturation_options, min=0, max=200),
+ NumberRange(name="hue", required=0, options=hue_options, min=0, max=200),
+
+ NumberRange(name="percentbeveled", required=0, options=percentbeveled_options, min=0, max=100),
+ NumberRange(name="rotate", required=0, options=rotate_options, min=0, max=360),
+ NumberRange(name="tilt", required=0, options=tilt_options, min=0, max=360),
+
+
+ MultiSelect(name="flop", required=0, options=flop_options),
+ MultiSelect(name="flip", required=0, options=flip_options),
+ ]