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: 98,336

    I am told:

    (function(){
    	
    	var clrUser = ColorDialog.getColor();
    	print( clrUser.isValid() );
    	
    })();
  • kabexefkabexef Posts: 60
    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.