Giter Club home page Giter Club logo

Comments (8)

Laptopmini avatar Laptopmini commented on May 21, 2024

+1

from chromacolorpicker.

V-FEXrt avatar V-FEXrt commented on May 21, 2024

@joncardasis Ideally this is something I would like to have as well. Maybe it is something we can work on together?

from chromacolorpicker.

joncardasis avatar joncardasis commented on May 21, 2024

I've played with the idea before (I'm just getting to maintaining some older projects atm like this one). I'm curious of how shades of gray could be supported with the current design of the control since the ring is based on hue and the slider is based on intensity and blends between black and white.

The picker should be able to select a gray color rgba(0.5, 0.5, 0.5, 1) and then the shader could take care of the spectrum between gray and black and gray and white respectively.

@V-FEXrt One idea I came up with is this:
idea

When the handle is lifted up and if a supportsShadesOfGray: Bool property is true, then the middle plus button will become gray, the plus will disappear and the handle can move freeform within the bounds of the circle. (Since color is based on the angle from the center point this could still work)

If the handle is moved to the center button (using CGRects contains(_ :) method) the handle color changes to gray and if let go it will go back to the original lifted space on the circle and become gray. The shade slider would work just fine from there.

This would require quite a bit of rework as to how the control functions and making sure everything 'snaps' into place.

@V-FEXrt how does this appeal to you? Any suggestions are welcome 😸

from chromacolorpicker.

joncardasis avatar joncardasis commented on May 21, 2024

Sitting on the idea I found one I think I'll be implementing soon.

possible-solution

What I am now planning to do:

  • Add a public var supportsShadesOfGray: Bool property
  • When supportsShadesOfGray is true a toggle indicator will appear in the upper left of the control
  • This toggle indicator will be gray when the picker is in "hue mode" and when tapped, will turn to an arbitrary color and the picker will switch to "grayscale mode"

This way it is optional to implement, minimal effort, doesn't break the current design pattern, and allows for shades of gray.

from chromacolorpicker.

V-FEXrt avatar V-FEXrt commented on May 21, 2024

Hmm, I really like the first suggestion, but the second one seems more reasonable, and perfectly acceptable for what I need. Is there anything in the implementation that you would like me to help with?

from chromacolorpicker.

joncardasis avatar joncardasis commented on May 21, 2024

@V-FEXrt I just went ahead and merged to master. Hopefully, this solution will work for those who need shades of gray 👍

from chromacolorpicker.

joncardasis avatar joncardasis commented on May 21, 2024

I am closing this issue as gray shades are now supported :)

from chromacolorpicker.

V-FEXrt avatar V-FEXrt commented on May 21, 2024

Looks great!

from chromacolorpicker.

Related Issues (20)

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.