up seafile
This commit is contained in:
@@ -13,7 +13,7 @@ type Preset struct {
|
||||
// gelParams are the knobs shared by the layered "gel" stacks.
|
||||
var gelParams = map[string]bool{
|
||||
"gradient": true, "shine": true, "outline_color": true, "outline_width": true,
|
||||
"halo": true, "shadow": true, "bevel_offset": true,
|
||||
"halo": true, "shadow": true, "bevel_offset": true, "fx": true,
|
||||
}
|
||||
|
||||
// Presets is the built-in style registry, keyed by preset name.
|
||||
@@ -23,8 +23,8 @@ var Presets = map[string]Preset{
|
||||
Label: "Gel gold",
|
||||
AllowedParams: gelParams,
|
||||
Defaults: StyleParams{
|
||||
Gradient: []string{"#FFE15A", "#FFC312", "#E07A00"},
|
||||
Shine: &Shine{Coverage: 0.52, Opacity: 0.95},
|
||||
Gradient: []string{"#FFE22D", "#FFD600", "#FFCC00"}, // bright XV9Q yellows; orange depth comes from the FX inner shadow
|
||||
Shine: &Shine{Coverage: 0.6, Opacity: 1},
|
||||
OutlineColor: "#2a3f5c", OutlineWidth: 10,
|
||||
Halo: &Halo{Color: "#cdd9e4", Blur: 6, Opacity: 0.4},
|
||||
Shadow: &ShadowFx{Dx: 6, Dy: 9, Blur: 5, Color: "#14243a", Opacity: 0.55},
|
||||
|
||||
@@ -85,6 +85,27 @@ type StyleParams struct {
|
||||
Shadow *ShadowFx `json:"shadow,omitempty"`
|
||||
BevelOffset *Bevel `json:"bevel_offset,omitempty"`
|
||||
Color string `json:"color,omitempty"`
|
||||
Fx *FxParams `json:"fx,omitempty"`
|
||||
}
|
||||
|
||||
// FxParams tunes the canvas call renderer (glossy bubble / western 3D). All
|
||||
// optional pointers — nil falls back to the renderer's per-preset default.
|
||||
// Persisted in the template so per-call tweaks survive a round-trip; the values
|
||||
// are consumed entirely by the frontend (textFx.ts).
|
||||
type FxParams struct {
|
||||
Plump *float64 `json:"plump,omitempty"`
|
||||
Edge *float64 `json:"edge,omitempty"`
|
||||
OuterW *float64 `json:"outerw,omitempty"`
|
||||
Gloss *float64 `json:"gloss,omitempty"`
|
||||
GlossH *float64 `json:"gloss_h,omitempty"`
|
||||
GlossI *float64 `json:"gloss_i,omitempty"`
|
||||
InnerB *float64 `json:"inner_b,omitempty"`
|
||||
Depth *float64 `json:"depth,omitempty"`
|
||||
Angle *float64 `json:"angle,omitempty"`
|
||||
Slant *float64 `json:"slant,omitempty"`
|
||||
Grunge *float64 `json:"grunge,omitempty"`
|
||||
Bevel *float64 `json:"bevel,omitempty"`
|
||||
Seed *float64 `json:"seed,omitempty"`
|
||||
}
|
||||
|
||||
// setKeys lists the JSON names of the params that are actually set, for
|
||||
@@ -118,6 +139,9 @@ func (p *StyleParams) setKeys() []string {
|
||||
if p.Color != "" {
|
||||
keys = append(keys, "color")
|
||||
}
|
||||
if p.Fx != nil {
|
||||
keys = append(keys, "fx")
|
||||
}
|
||||
return keys
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user