Coder Social home page Coder Social logo

nova-color-field's People

Contributors

ahinkle avatar azadgh95 avatar dongilbert avatar ianrobertsff avatar jorgv avatar marvinrabe avatar mertasan avatar p-jrv avatar tarpsvo avatar timothyasp avatar yuq140 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

nova-color-field's Issues

Without

Hey @Tarpsvo

Great work you did with this colour picker!

Is there currently an option to hide the suggestions completely? I want to use it as a manual input field showing the colours after saving the form.

Best regards
Sebastian

grafik

Is there any way to customize swatches pallete?

I would like to load pallete of tailwind colors into swatches tool but it does not work. Only mode where I can load my pallete is "simple". Is there any workaround to use this field and customize swatch mode?

Alpha channel not working properly using `hex8` mode in Nova 3 (v `1.2`)

Hi there.

I am having issues using the alpha channel in either hex8 or rgba mode using version 1.2.2 of the package. Not sure if the problem is also present in v2 and Nova 4.

HEX8 mode (#rrggbbAA notation)

Using Color::make('hex8')->chrome()->displayAs('hex8')->saveAs('hex8') - picked example color #6657aa94

  • will properly store the picked color with the alpha channel to the database - #6657aa94
  • won't properly render the color on details page using the hex string - it uses background-color: rgba(102, 87, 170, 0.58); instead of style="background-color: #6657aa94;
  • won't properly load the alpha to the color picker when editing a record to change the color
Actual Expected
Screen Shot 2022-09-15 at 15 20 48 Screen Shot 2022-09-15 at 15 22 32

Note it would be nice if the main color (the square) also is updated with the proper color after the picker is closed (or even while the color picker is open).

Related issues

Let me know what do you think. I could work on those fixes and enhancements this weekend maybe.

DependsOn does not work

I cannot seem to get it working under Nova 4. Is it supported? I could really use it in my project.

Not working on latest version of nova

On the latest version of nova the field doesn't seem to work properly.
I tried different types, but all seem to give the same errors:

It only affects the adding of a new color, the detail field and edit field work fine.
For now the workaround seems to just give the field a default value:

Color::make('Color')->default(function () { return '#fff'; }),

TypeError: Cannot read property 'h' of undefined
TypeError: Cannot read property 'hex' of undefined

Nova 3.29.0
PHP 8

Alpha channel not working properly using `rgba` mode in Nova 3 (v `1.2`)

Hi there.

There are issues using the alpha channel in rgba mode with version 1.2.2 of the package.

RGBA

Using Color::make('rgba')->chrome()->displayAs('rgba')->saveAs('rgba') and picked example color
rgba(51, 84, 151, 0.43)

  • will properly store the picked color with the alpha channel to the database as json - {"r":51,"g":84,"b":151,"a":0.43137254901960786}
  • won't render the color on details page at all and will show the stored json value as string {"r":51,"g":84,"b":151,"a":0.43137254901960786} instead as rgba value like it really should
  • won't load the rgba color at all, it always loads black using background-color: rgb(0,0,0) instead of rgba(51, 84, 151, 0.43)

Chrome picker issue

When using the chrome picker, it always defaults to the hex mode/ux of the picker. It would be nice if we can control that with the displayAs() method is used. For example when having displayAs('rgba') chained on the field, when the picker is first opened it should default to the rgba ux/styles of the picker instead of hex.

Even better we can use that to automatically set the format which should be used to store the value.

Color::compact() not compatible with Laravel\Nova\Fields\Field::compact in Nova 4

It seems that the lastest release of Nova 4 (4.26.0) added a compact() method to Field which Color extends to.

This leads to the following error while trying to render the Color field
Declaration of Outl1ne\\NovaColorField\\Color::compact() must be compatible with Laravel\\Nova\\Fields\\Field::compact(bool $compact = true)

  • Laravel Version: 10.14.1
  • Nova Version: 4.26.0
  • PHP Version: 8.1
  • Nova-color-field Version: 2.0.2

Latest version breaks nova

Hi,

after updating to 1.1 I see an error TypeError: t is undefined and the field stops working.

Any idea what that could be?

Clear field

How can I clear the color value? If empty the field fills again with previous color...is there a way to allow empty value?

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.