|
Groovy example source code file (MyColor.groovy)
The Groovy MyColor.groovy source codepackage groovy.operator import java.awt.Color class MyColor { Color delegate MyColor(int r, int g, int b) { delegate = new Color(r, g, b) } MyColor negative() { return new MyColor(delegate.red.intdiv(2), delegate.green.intdiv(2), delegate.blue.intdiv(2)) } MyColor positive() { return new MyColor(2 * delegate.red - 1, 2 * delegate.green - 1, 2 * delegate.blue - 1) } String toString() { return delegate.toString() } } Other Groovy examples (source code examples)Here is a short list of links related to this Groovy MyColor.groovy source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.