svg-icons-2.9.3.0: Svg Icons and more
Safe HaskellSafe-Inferred
LanguageHaskell2010

SvgIcons.Core.Utils

Synopsis

Documentation

evenOddSplit :: [a] -> ([a], [a]) Source #

Splits a list xs into two lists:

  • The first one contains all odd positioned elements of xs
  • The second one contains all even positioned elements of xs

addXmlns :: Svg -> Svg Source #

Takes some Svg entity and adds two attributes:

(.:) :: (AttributeValue -> Attribute) -> Float -> Attribute infixl 5 Source #

Handy operator that converts a Float number into an AttributeValue and feeds it to the Attribute function. Example:

S.path 
  ! (A.strokeWidth .: 0.1) 

distance :: (Float, Float) -> (Float, Float) -> Float Source #

Euclidian distance between two points.

horizontalMirrorMatrix :: AttributeValue Source #

Matrix for the horizontal symmetry respect to the axis x=0. Use it with the transform Attribute:

S.path
  ! A.transform horizontalMirrorMatrix

verticalMirrorMatrix :: AttributeValue Source #

Matrix for the vertical symmetry respect to the axis y=0. Use it with the transform Attribute:

S.path
  ! A.transform (verticalMirrorMatrix <> rotateAround 45 0 0)

frame Source #

Arguments

:: Float

stroke-width

-> String

stroke color

-> Float

x0

-> Float

y0

-> Float

width

-> Float

height

-> Svg

resulting svg

frame is mainly used for testing purposes. It draws coordinate axis.

Takes the 4 numbers of the viewbox (x0, y0, width, height) and returns a path which connects all consecutive corners of the viewbox and also connects opposite middle points of the sides of the viewbox.

rectangleWithRoundCorners Source #

Arguments

:: Float

corner radius

-> (Float, Float)

(semiwidth, semiheight)

-> (Float, Float)

central point (intersection of diagonals)

-> Path

resulting path

Path of a rectangle with rounded corners.