4import Native.Color as Native
6data Color = Color Int Int Int Float
8-- Create RGB colors with an alpha component for transparency.
9-- The alpha component is specified with numbers between 0 and 1.
10rgba : Int -> Int -> Int -> Float -> Color
13-- Create RGB colors from numbers between 0 and 255 inclusive.
14rgb : Int -> Int -> Int -> Color
15rgb r g b = Color r g b 1
25yellow = Color 255 255 0 1
27cyan = Color 0 255 255 1
29magenta = Color 255 0 255 1
34white = Color 255 255 255 1
37gray = Color 128 128 128 1
39grey = Color 128 128 128 1
42maroon = Color 128 0 0 1
46green = Color 0 128 0 1
49teal = Color 0 128 128 1
51purple = Color 128 0 128 1
54violet = Color 238 130 238 1
56forestGreen = Color 34 139 34 1
58-- Produce a “complementary color”.
59-- The two colors will accent each other.
60complement : Color -> Color
61complement = Native.complement
63-- Create [HSV colors](http://en.wikipedia.org/wiki/HSL_and_HSV)
64-- with an alpha component for transparency.
65hsva : Float -> Float -> Float -> Float -> Color
68-- Create [HSV colors](http://en.wikipedia.org/wiki/HSL_and_HSV).
69-- This is very convenient for creating colors that cycle and shift.
71-- hsv (degrees 240) 1 1 == blue
72hsv : Float -> Float -> Float -> Color
76 = Linear (Float,Float) (Float,Float) [(Float,Color)]
77 | Radial (Float,Float) Float (Float,Float) Float [(Float,Color)]
79-- Create a linear gradient. Takes a start and end point and then a series
80-- of “color stops” that indicate how to interpolate between
81-- the start and end points. See [this example](/edit/examples/Elements/LinearGradient.elm) for
82-- a more visual explanation.
83linear : (number, number) -> (number, number) -> [(Float,Color)] -> Gradient
86-- Create a radial gradient. First takes a start point and inner radius.
87-- Then takes an end point and outer radius. It then takes a series
88-- of “color stops” that indicate how to interpolate between
89-- the inner and outer circles. See [this example](/edit/examples/Elements/RadialGradient.elm) for
90-- a more visual explanation.
91radial : (number,number) -> number -> (number,number) -> number -> [(Float,Color)] -> Gradient
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list