Comments (8)
+1
from chromacolorpicker.
@joncardasis Ideally this is something I would like to have as well. Maybe it is something we can work on together?
from chromacolorpicker.
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:
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.
Sitting on the idea I found one I think I'll be implementing soon.
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.
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.
@V-FEXrt I just went ahead and merged to master. Hopefully, this solution will work for those who need shades of gray 👍
from chromacolorpicker.
I am closing this issue as gray shades are now supported :)
from chromacolorpicker.
Looks great!
from chromacolorpicker.
Related Issues (20)
- 3 Swift Compiler Warnings with XCode 10 beta 6 HOT 2
- adjustToColor() doesn't play nicely with supportsShadesOfGray HOT 1
- Swift 5 Compile Errors HOT 2
- Xcode 10.2 compiler failed, I can't build my project :( HOT 9
- Input color value selection color
- Is it possible to select a color by clicking? HOT 2
- color picker handle HOT 3
- Alpha color scroll not working smoothly
- ChromaColorPicker and ChromaBrightnessSlider call events twice HOT 1
- Change handle of place HOT 1
- Autolayout issue HOT 1
- Adding option for vertical brightness slider and custom brightness slider handle shape HOT 1
- No way to remove handles or update their color position in code HOT 1
- currentHandle not initialized? HOT 4
- Swift Package Manager Error
- iOS 14 issues in modal
- Crashes in iOS 9
- How could I add event to the home handle?
- Suggestion: set default handle
- Support color extraction for pictures
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chromacolorpicker.