DzColorDialog - How to notice that the user pressed 'cancel'

If I press "Cancel" in the DzColor dialog, the color "Black" is returned (even if I have set an initial color in the call to getColor()). So in the calling script I cannot distinguish whether the user has selected "Black" or pressed "Cancel". How can I recognize this?

Comments

  • Richard HaseltineRichard Haseltine Posts: 101,340

    I am told:

    (function(){
    	
    	var clrUser = ColorDialog.getColor();
    	print( clrUser.isValid() );
    	
    })();
  • kabexefkabexef Posts: 77
    edited March 30

    Richard Haseltine said:

    I am told:

    (function(){
    	
    	var clrUser = ColorDialog.getColor();
    	print( clrUser.isValid() );
    	
    })();
    

    Thanks, it works :-).

     

    Post edited by Richard Haseltine on
Sign In or Register to comment.