querkmachine/nova-randomize-everything

Consider adding more formatting options for color generators

Opened this issue · 0 comments

Consider adding more formatting options for color generators.

Note
CSS Colors Level 4 no longer requires commas in CSS color functions, and implements a slash syntax for alpha channels: rgba(123, 45, 67, .8) in old is equivalent to rgb(123 45 67 / .8) in new.

New color functions introduced by Level 4, hwb, lch and lab, only support the new syntax. Of these, as of writing, only hwb has widespread support in browsers.

Possible settings changes

  • Add a setting option for which generators to include in menus, so that not all of them are listed all the time (not sure if this is possible?)
  • Add a setting to toggle including alpha channel values
  • Remove CSS compliant format setting (superceded by selectable format options)

Possible formats

Format Example w/o alpha Example w/ alpha
Hexadecimal #bada55 #bada5547
RGB 123, 45, 67
HSL 123, 45%, 67%
CSS RGB rgb(123, 45, 67)
or rgb(123 45 67)
rgba(123, 45, 67, 0.8)
or rgb(123 45 67 / 0.8)
CSS HSL hsl(123, 45%, 67%)
or hsl(123 45% 67%)
hsla(123, 45%, 67%, 0.8)
or hsl(123 45% 67% / 0.8)
CSS HWB hwb(123 45% 67%) hwb(123 45% 67% / 0.8)
CSS LCH lch(12.3% 45% 67) lch(12.3% 45% 67 / 0.8)
CSS Lab lab(12.34% -56 78) lab(12.34% -56 78 / 0.9)
NSColor RGB NSColor(red: 0.123, green: 0.45, blue: 0.67, alpha: 0.8)
NSColor HSB NSColor(hue: 0.123, saturation: 0.45, brightness: 0.67, alpha: 0.8)
UIColor RGB UIColor(red: 0.123, green: 0.45, blue: 0.67, alpha: 0.8)
UIColor HSB UIColor(hue: 0.123, saturation: 0.45, brightness: 0.67, alpha: 0.8)
SwiftUI RGB Color(red: 0.123, green: 0.45, blue: 0.67, alpha: 0.8)
SwiftUI HSB Color(hue: 0.123, saturation: 0.45, brightness: 0.67, alpha: 0.8)
SwiftUI Literal #colorLiteral(red: 0.123, green: 0.45, blue: 0.67, alpha: 0.8)
Obj-C NSColor RGB [NSColor colorWithCalibratedRed:0.123 green:0.45 blue:0.67 alpha:0.8]
Obj-C UIColor RGB [UIColor colorWithRed:0.123 green:0.45 blue:0.67 alpha:0.8]
.net RGB Color.FromRgb(123, 45, 67) Color.FromArgb(204, 123, 45, 67)
Java RGB new Color(123, 45, 67) new Color(123, 45, 67, 204)
Android RGB Color.rgb(123, 45, 67) Color.argb(204, 123, 45, 67)