Added Gray #63

This commit is contained in:
Lucas Payr 2021-06-03 20:38:32 +02:00
parent de826acea4
commit cb10b08dec
2 changed files with 20 additions and 5 deletions

View File

@ -1,5 +1,5 @@
module Widget.Material exposing
( Palette, defaultPalette, darkPalette
( Palette, defaultPalette, darkPalette, gray
, containedButton, outlinedButton, textButton
, iconButton, toggleButton, buttonRow
, switch
@ -33,7 +33,7 @@ If you have any suggestions or improvements, be sure to leave a [PR or a Issue](
# Palette
@docs Palette, defaultPalette, darkPalette
@docs Palette, defaultPalette, darkPalette, gray
# Button
@ -157,6 +157,7 @@ import Internal.Switch exposing (SwitchStyle)
import Internal.Tab exposing (TabStyle)
import Internal.TextInput exposing (TextInputStyle)
import Widget.Icon exposing (Icon)
import Widget.Material.Color as MaterialColor
import Widget.Snackbar exposing (SnackbarStyle)
@ -213,6 +214,14 @@ darkPalette =
Palette.darkPalette
{-| generates a "grayish" color that matches the on-surface color.
-}
gray : Palette -> Color
gray palette =
palette.on.surface
|> MaterialColor.scaleOpacity 0.14
--------------------------------------------------------------------------------
-- B U T T O N

View File

@ -2,8 +2,9 @@ module Widget.Material.Color exposing
( buttonHoverOpacity, buttonFocusOpacity, buttonPressedOpacity, buttonDisabledOpacity, buttonSelectedOpacity
, accessibleTextColor, accessibleWithTextColor
, withShade, scaleOpacity
, dark, gray
, dark
, toCIELCH, fromCIELCH, shadow, fromColor, textAndBackground
, gray
)
{-| This module contains functions to adapt color in various ways.
@ -33,13 +34,18 @@ then the javascript material design implementation.
## Predefined Colors
@docs dark, gray
@docs dark
## Utility Functions
@docs toCIELCH, fromCIELCH, shadow, fromColor, textAndBackground
## DEPRECATED
@docs gray
-}
import Color exposing (Color)
@ -237,7 +243,7 @@ scaleOpacity opacity =
>> Color.fromRgba
{-| gray
{-| DEPRECATED use Material.gray instead.
-}
gray : Color
gray =