Giter Site home page Giter Site logo

simonh1000 / elm-colorpicker Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 5.0 191 KB

Elm library to implement a color picker tool

Home Page: http://package.elm-lang.org/packages/simonh1000/elm-colorpicker/latest

License: MIT License

Elm 79.68% HTML 1.04% JavaScript 17.87% CSS 1.41%

elm-colorpicker's People

Contributors

dstreet26 avatar elm-review-bot avatar simonh1000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

elm-colorpicker's Issues

hex2Color and color2Hex relies on 255 color format

Thanks for making this package, I use it for my Elm-powered knitting pattern designer.

I found a bug in the hex conversion functions, since elm-hex needs a value between 0 and 255 (for colors), it will not work when using the values directly from Color which is now between 0 and 1. color2Hex can be fixed by multiplying with 255 in the List.map and hex2Color by using Color.rgb255 instead of Color.rgb.

I can make a pull request attempting to fix this, but since they are no longer used internally and elm-color has a toCssString function. You might want to remove them altogether. Then you can also drop the elm-hex dependency.

Example code missing dependency

It wasn't immediately obvious to me that avh4/elm-color also needs to be installed & imported in order for the example code to run.

Perhaps something like:

import Html exposing (Html)
import ColorPicker 
import Color exposing (Color)

might make it more clear that the example relies on elm-color in particular?

When using a predefined value, hue is not set correctly.

Thanks for this ColorPicker. I really like it.

When not starting with white or black though, the hue in the colorpicker is incorrect:

Hue should be at red, is at cyan

Here the relevant code:

type alias Model =
    { colorPicker : ColorPicker.State }


initialModel : Model
initialModel =
    { colorPicker = ColorPicker.empty }


type Msg = ColorPickerMsg ColorPicker.Msg


update : Msg -> Model -> Model
update msg model =
    model


view : Model -> Html Msg
view model =
    div []
        [ Html.map ColorPickerMsg <| ColorPicker.view (Color.rgb 1.0 0.0 0.0) model.colorPicker
        ]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.