Maintainer | Malte Harder <malte.harder@gmail.com> |
---|
Styles in craftwerk are nodes in the figure tree and the style at the node is
applied to all subnodes. If a field of a style is empty (i.e its value
is Nothing
) the value of the next parent style node is applied.
- data StyleProperties = StyleProperties {
- lineWidth :: Maybe Double
- lineColor :: Maybe FigureColor
- fillColor :: Maybe FigureColor
- fill :: Maybe Bool
- stroke :: Maybe Bool
- clip :: Maybe Bool
- closePath :: Maybe Bool
- dashes :: Maybe [Double]
- dashPhase :: Maybe Double
- lineCap :: Maybe LineCap
- lineJoin :: Maybe LineJoin
- miterLimit :: Maybe Double
- arrowTips :: Maybe ArrowTips
- data LineCap
- data LineJoin
- data ArrowTip
- = TipNone
- | TipDefault
- emptyStyle :: StyleProperties
- newStyle :: StyleProperties
- defaultStyle :: StyleProperties
- setLineWidth :: Maybe Double -> StyleProperties
- fillOnly :: StyleProperties
- strokeOnly :: StyleProperties
- yes :: Maybe Bool
- no :: Maybe Bool
- rgb :: Double -> Double -> Double -> Maybe FigureColor
- width :: Double -> Maybe Double
- verythin :: Maybe Double
- thin :: Maybe Double
- semithick :: Maybe Double
- thick :: Maybe Double
- verythick :: Maybe Double
- ultrathick :: Maybe Double
- limit :: Double -> Maybe Double
- phase :: Double -> Maybe Double
- getProperty :: StyleProperties -> (StyleProperties -> Maybe a) -> a
- mergeProperties :: StyleProperties -> StyleProperties -> StyleProperties
- arrow :: (ArrowDummy -> ArrowTips) -> Maybe ArrowTips
- (<=>) :: ArrowDummy -> ArrowTips
- (===) :: ArrowDummy -> ArrowTips
- (==>) :: ArrowDummy -> ArrowTips
- (<==) :: ArrowDummy -> ArrowTips
Data types
data StyleProperties Source
A record holding all possible properties.
StyleProperties | |
|
Named styles
emptyStyle :: StylePropertiesSource
A style where no property has been set.
newStyle :: StylePropertiesSource
Alias for empty style, makes style construction nicer.
defaultStyle :: StylePropertiesSource
The default style used at the root node of any Figure
.
Property values
ultrathick :: Maybe DoubleSource
Width 1.6.
Property access and merging
getProperty :: StyleProperties -> (StyleProperties -> Maybe a) -> aSource
Read a property from a style property record returning the value of
the default style if the value is Nothing
.
mergeProperties :: StyleProperties -> StyleProperties -> StylePropertiesSource
Merge two property records, where the second argument overwrites fields of
the first unless a field is Nothing
.